21 include_once (
'FDL/Lib.Dir.php');
22 include_once (
'WHAT/Class.UserToken.php');
24 $action->lay->set(
'CALLBACK_OK', False);
25 $action->lay->set(
'CALLBACK_NOT_OK', False);
26 $action->lay->set(
'ON_ERROR_CONTACT',
$action->getParam(
'SMTP_FROM'));
28 $token = getHttpVars(
'token');
31 if (!is_object($utok)) {
32 error_log(__CLASS__ .
"::" . __FUNCTION__ .
" " .
"new UserToken(" . $token .
") returned with error : " . $utok);
33 $action->lay->set(
'CALLBACK_NOT_OK', True);
36 if (!$utok->isAffected()) {
37 error_log(__CLASS__ .
"::" . __FUNCTION__ .
" " .
"no element found for token " . $token);
38 $action->lay->set(
'CALLBACK_NOT_OK', True);
45 error_log(__CLASS__ .
"::" . __FUNCTION__ .
" " .
"Token " . $utok->token .
" has expired (expire = " . $utok->expire .
")");
46 $action->lay->set(
'CALLBACK_NOT_OK', True);
47 $utok->deleteExpired();
51 $freedomdb =
$action->getParam(
'FREEDOM_DB');
52 if ($freedomdb ==
"") {
53 error_log(__CLASS__ .
"::" . __FUNCTION__ .
" " .
"FREEDOM_DB is empty");
54 $action->lay->set(
'CALLBACK_NOT_OK', True);
58 $iuser =
new_Doc($freedomdb, $utok->userid);
59 if (!is_object($iuser)) {
60 error_log(__CLASS__ .
"::" . __FUNCTION__ .
" " .
"new Doc(" . $userid .
") returned with error : " . $iuser);
61 $action->lay->set(
'CALLBACK_NOT_OK', True);
65 $err = $iuser->disableEditControl();
67 error_log(__CLASS__ .
"::" . __FUNCTION__ .
" " .
"error disabling edit controls on document : " .
$err);
68 $action->lay->set(
'CALLBACK_NOT_OK', True);
75 error_log(__CLASS__ .
"::" . __FUNCTION__ .
" " .
"setPassword() returned error : " .
$err);
76 $action->lay->set(
'CALLBACK_NOT_OK', True);
82 $action->lay->set(
'CALLBACK_NOT_OK', True);
83 error_log(__CLASS__ .
"::" . __FUNCTION__ .
" " .
"sendResponse() returned with error : " .
$err);
87 $action->lay->set(
'CALLBACK_OK', True);
89 $err = $utok->delete();
91 error_log(__CLASS__ .
"::" . __FUNCTION__ .
" " .
"utok->delete() returned with error : " .
$err);
99 include_once (
'WHAT/Class.UserToken.php');
100 include_once (
"FDL/sendmail.php");
102 $us_mail = $userdoc->getValue(
'us_mail');
103 $us_fname = $userdoc->getValue(
'us_fname');
104 $us_lname = $userdoc->getValue(
'us_lname');
106 if ($us_mail ==
"") {
107 error_log(__CLASS__ .
"::" . __FUNCTION__ .
" " .
"Empty us_mail for user " . $userdoc->getValue(
'id'));
108 return "Empty us_mail for user " . $userdoc->getValue(
'id');
112 $subject =
$action->getParam(
'AUTHENT_CALLBACKREQPASSWD_MAIL_SUBJECT');
115 if ($layout == NULL) {
116 return "error creating new Layout from $layoutPath";
119 $layout->set(
'US_MAIL', $us_mail);
120 $layout->set(
'US_FNAME', $us_fname);
121 $layout->set(
'US_LNAME', $us_lname);
126 $mimemail =
new Fdl_Mail_Mime(
"\r\n");
131 return "Error: sendmail() returned with $ret";