plugins/SpecialUserFuncs.php
changeset 116 77c75179bb95
parent 115 261f367623af
child 119 9de392a67964
child 125 fb31c951d3a2
equal deleted inserted replaced
115:261f367623af 116:77c75179bb95
    65     
    65     
    66     $paths->add_page(Array(
    66     $paths->add_page(Array(
    67       \'name\'=>\'Activate user account\',
    67       \'name\'=>\'Activate user account\',
    68       \'urlname\'=>\'ActivateAccount\',
    68       \'urlname\'=>\'ActivateAccount\',
    69       \'namespace\'=>\'Special\',
    69       \'namespace\'=>\'Special\',
    70       \'special\'=>0,\'visible\'=>0,\'comments_on\'=>0,\'protected\'=>1,\'delvotes\'=>0,\'delvote_ips\'=>\'\',
    70       \'special\'=>0,\'visible\'=>1,\'comments_on\'=>0,\'protected\'=>1,\'delvotes\'=>0,\'delvote_ips\'=>\'\',
    71       ));
    71       ));
    72     
    72     
    73     $paths->add_page(Array(
    73     $paths->add_page(Array(
    74       \'name\'=>\'Captcha\',
    74       \'name\'=>\'Captcha\',
    75       \'urlname\'=>\'Captcha\',
    75       \'urlname\'=>\'Captcha\',
    76       \'namespace\'=>\'Special\',
    76       \'namespace\'=>\'Special\',
    77       \'special\'=>0,\'visible\'=>0,\'comments_on\'=>0,\'protected\'=>1,\'delvotes\'=>0,\'delvote_ips\'=>\'\',
    77       \'special\'=>0,\'visible\'=>1,\'comments_on\'=>0,\'protected\'=>1,\'delvotes\'=>0,\'delvote_ips\'=>\'\',
    78       ));
    78       ));
    79     
    79     
    80     $paths->add_page(Array(
    80     $paths->add_page(Array(
    81       \'name\'=>\'Forgot password\',
    81       \'name\'=>\'Forgot password\',
    82       \'urlname\'=>\'PasswordReset\',
    82       \'urlname\'=>\'PasswordReset\',
   826 
   826 
   827 function page_Special_ActivateAccount()
   827 function page_Special_ActivateAccount()
   828 {
   828 {
   829   global $db, $session, $paths, $template, $plugins; // Common objects
   829   global $db, $session, $paths, $template, $plugins; // Common objects
   830   $user = $paths->getParam(0);
   830   $user = $paths->getParam(0);
   831   if(!$user) die_friendly('Account activation error', '<p>The URL was incorrect.</p>');
   831   if(!$user) die_friendly('Account activation error', '<p>This page can only be accessed using links sent to users via e-mail.</p>');
   832   $key = $paths->getParam(1);
   832   $key = $paths->getParam(1);
   833   if(!$key) die_friendly('Account activation error', '<p>The URL was incorrect.</p>');
   833   if(!$key) die_friendly('Account activation error', '<p>This page can only be accessed using links sent to users via e-mail.</p>');
   834   $s = $session->activate_account(str_replace('_', ' ', $user), $key);
   834   $s = $session->activate_account(str_replace('_', ' ', $user), $key);
   835   if($s > 0) die_friendly('Activation successful', '<p>Your account is now active. Thank you for registering.</p>');
   835   if($s > 0) die_friendly('Activation successful', '<p>Your account is now active. Thank you for registering.</p>');
   836   else die_friendly('Activation failed', '<p>The activation key was probably incorrect.</p>');
   836   else die_friendly('Activation failed', '<p>The activation key was probably incorrect.</p>');
   837 }
   837 }
   838 
   838