Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mahara
mahara
Commits
81f73567
Commit
81f73567
authored
Nov 16, 2006
by
Martyn Smith
Committed by
Martyn Smith
Nov 16, 2006
Browse files
Email class started
parent
a350e989
Changes
1
Hide whitespace changes
Inline
Side-by-side
htdocs/artefact/internal/lib.php
View file @
81f73567
...
...
@@ -200,7 +200,63 @@ class ArtefactTypeCachedProfileField extends ArtefactTypeProfileField {
class
ArtefactTypeFirstname
extends
ArtefactTypeCachedProfileField
{}
class
ArtefactTypeLastname
extends
ArtefactTypeCachedProfileField
{}
class
ArtefactTypePreferredname
extends
ArtefactTypeCachedProfileField
{}
class
ArtefactTypeEmail
extends
ArtefactTypeCachedProfileField
{}
class
ArtefactTypeEmail
extends
ArtefactTypeProfileField
{
protected
$email_id
;
protected
$verified
;
public
function
__construct
(
$id
=
0
,
$data
=
null
)
{
$type
=
$this
->
get_artefact_type
();
if
(
!
empty
(
$id
))
{
return
parent
::
__construct
(
$id
,
$data
);
}
if
(
isset
(
$data
[
'owner'
])
&&
isset
(
$data
[
'email'
]))
{
$a
=
get_record
(
'artefact_internal_profile_email'
,
'email'
,
$data
[
'email'
],
'owner'
,
$data
[
'owner'
]);
if
(
!
$a
)
{
throw
new
ArtefactNotFoundException
(
'Profile Email field for user '
.
$data
[
'owner'
]
.
' email '
.
$data
[
'email'
]
.
' not found'
);
}
$this
->
title
=
$a
->
email
;
$this
->
verified
=
$a
->
verified
;
$this
->
id
=
$a
->
artefact
;
$this
->
owner
=
$a
->
owner
;
$this
->
artefacttype
=
$type
;
return
;
}
return
parent
::
__construct
(
$id
,
$data
);
}
public
function
commit
()
{
if
(
$this
->
verified
)
{
$this
->
commit_basic
();
}
if
(
empty
(
$this
->
email_id
))
{
$this
->
id
=
insert_record
(
'artefact_internal_profile_email'
,
(
object
)
array
(
'owner'
=>
$this
->
owner
,
'email'
=>
$this
->
title
,
'verified'
=>
$this
->
verified
,
)
);
}
else
{
// update_record('artefact', $fordb, 'id');
}
}
public
function
delete
()
{
if
(
$this
->
verified
)
{
$this
->
delete_basic
();
}
}
}
class
ArtefactTypeStudentid
extends
ArtefactTypeProfileField
{}
class
ArtefactTypeIntroduction
extends
ArtefactTypeProfileField
{}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment