}
- if (!isset($_REQUEST['ajax_body'])) {
- $this->title = "Login";
- return;
- }
- $this->masterTemplate = 'login.html';
-
- if (!empty($u)) {
- /** ---------- reset passwords ----- */
- $uu = explode('/', $u);
- if ($uu[0] != 'Reset') {
- $this->err('404', 'Invalid URL');
- }
- $u = DB_DataObject::factory('Person');
- if (!$u->get($uu[1])) {
- $this->err('404', 'Invalid URL');
- }
- $uu[2] = (int) $uu[2];
-
- if ($uu[2] < (time() - (60 * 60 * 24 * 2))) { // older than 2 days.
- HTML_FlexyFramework::run('ForgotPassword', array('errors' => array('reset_expired' => 1)));
- exit;
- }
- // print_R($u->genPassKey($uu[2]));
- if ($uu[3] != $u->genPassKey($uu[2])) {
- HTML_FlexyFramework::run('ForgotPassword', array('errors' => array('reset_invalid' => 1)));
- exit;
- }
- // do reset!!!.
-
- $pp = clone($u);
- $u->generatePassword();
- $u->update($pp);
- $u->sendTemplate('reset_password', $this);
-
- $this->warnings = array('password_sent' => true);
-
- }
-
- if (!empty($ar)) {
- foreach($ar as $k=>$v) {
- $this->$k = $v;
- }
- }
-
-
-
- if (!empty($_POST)) {
- require_once 'HTML/Template/Flexy/Factory.php';
- $this->elements = HTML_Template_Flexy_Factory::fromArray( $_POST ,$this->elements);
-
- }
-
+
+ $this->jerr("invalid url");
return;
}
function errmsg($str) {