function handleJSON_changePasswordElastix($smarty, $module_name) { $jsonObject = new PaloSantoJSON(); $output = setUserPassword(); $jsonObject->set_status($output['status'] === TRUE ? 'true' : 'false'); $jsonObject->set_error($output['msg']); return $jsonObject->createJSON(); }
function createUser($username, $email, $password) { setDat('users/' . $username, 'user-information', 'username', $username); setDat('users/' . $username, 'user-information', 'email', $email); setDat('users/' . $username, 'user-information', 'email-status', 'not-verified'); setDat('users/' . $username, 'user-information', 'email-code', rand(11111, 99999)); setUserPassword($username, $password, $email); }
function handleJSON_changePasswordElastix($smarty, $module_name) { Header('Content-Type: application/json'); $jsonObject = new PaloSantoJSON(); $output = setUserPassword(); $jsonObject->set_status($output['status'] === TRUE ? 'true' : 'false'); if ($output['status']) { $jsonObject->set_message($output['msg']); } else { $jsonObject->set_error($output['msg']); } return $jsonObject->createJSON(); }
function passwordFormSubmitted() { if ($_POST['pass1'] != $_POST['pass2']) { dieError("ERROR: Passwords do not match"); // has javascript checking, we should never hit this error. } if (!isValidUserPassword(getUsername(), $_POST['pass0'])) { echo "<h2>Incorrect Old password entered. Please try again.</h2>\n"; echo file_get_contents("html/password.html"); die(' '); } // now we insert it into the database if (setUserPassword($_POST['pass1'])) { echo "<h1>Password Changed</h1>\n"; echo "<form><input type=\"button\" name=\"continue\" value=\"Continue\" onClick=\"parent.main_popupWindowCancel()\"></form>\n"; } else { dieError("Password Change Failed. Please contact the administrator"); } }
$app->get('/unsubscribe/:guid', function ($guid) use($app) { //TODO: Deal with this somehow. $app->render('html/unsubscribe.html', array('guid', $guid)); }); $app->get('/profile', function () use($app) { $app->render('html/profile.html'); })->name('profile'); $app->post('/profile/details', function () use($app) { setUserInfo($app->auth->getIdentity()['user'], $app->db, $app->request->post('email')); $data = $app->auth->getIdentity(); $data['email'] = $app->request->post('email'); $app->auth->getStorage()->write($data); $app->redirect($app->urlFor('profile')); }); $app->post('/profile/password', function () use($app) { setUserPassword($app->auth->getIdentity()['user'], $app->request->post('newPassword1'), $app->request->post('newPassword2')); $app->redirect($app->urlFor('profile')); }); $app->get('/admin', function () use($app) { $app->render('html/admin.html'); }); $app->get('/admin/allowances/list', function () use($app) { $users = getUsers($app->db, 'all'); $periods = $app->periods->getAllPeriods(); $app->render('html/allowances.html', array('users' => $users, 'periods' => $periods[1])); }); $app->get('/admin/allowances/list/json', function () use($app) { $search = isset($_GET['search']) ? $_GET['search'] : ''; $sort = isset($_GET['sort']) ? $_GET['sort'] : 'id'; $order = isset($_GET['order']) ? $_GET['order'] : 'ASC'; $limit = isset($_GET['limit']) ? $_GET['limit'] : '10';