<div class="form-group"> <label>Please fill in a new password</label> <input type="password" class='form-control' name='password'> </div> <div class="form-group"> <label>Please repeat filled in password</label> <input type="password" class='form-control' name='repeatPassword'> </div> <div class="form-group"> <input type="submit" class='btn btn-default' value='Reset password' name='submit'> </div> </form> <?php if (isset($_POST['submit'])) { if ($_POST['password'] == $_POST['repeatPassword']) { $user->update_password($_GET["ID"], $date->getTimestamp(), $_POST['password']); echo '<div class="alert alert-success" role="alert"><b>Succes!</b> Password changed. :)</div>'; } else { echo '<div class="alert alert-danger" role="alert"><b>Oh oh!</b> Passwords don\'t match :(</div>'; } } ?> </div> </div> </div> </body> <!-- Jquery CDN --> <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script> <!-- Latest compiled and minified JavaScript --> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js" integrity="sha384-0mSbJDEHialfmuBBQP6A4Qrprq5OVfW37PRR3j5ELqxss1yVqOtnepnHVP9aJ7xS" crossorigin="anonymous"></script> <!-- Custom JS -->
$password .= $char; } } } } // Reset old style shell_exec('stty ' . $oldStyle); // Return the password return $password; } $root = new User(['email' => User::ROOT_EMAIL, 'role' => 'admin']); print "email: {$root->email}\n"; print "fullname: "; $root->fullname = rtrim(fgets(STDIN)); print "password: "******"\n"; print "password (confirmation): "; $password_ = getPassword(); print "\n"; if (strcmp($password, $password_) !== 0) { fwrite(STDERR, "ERROR: password confirmation missmatch.\n"); exit(1); } $root->update_password($password); if ($root->save()) { print "\ndone.\n"; } else { fwrite(STDERR, "ERROR: something bad happened: " . print_r($root, true)); exit(1); }
$client->update_email($email); } if ($website != $client->website) { $client->update_website($website); } if ($username != $client->username) { $client->update_username($username); } if ($fullname != $client->fullname) { $client->update_fullname($fullname); } if ($fullname_public != $client->fullname_public) { $client->update_fullname_public($fullname_public); } if ($pass1 == $pass2 && strlen($pass1)) { $client->update_password($pass1); } if ($state != $client->state) { $client->update_state($state); } if ($city != $client->city) { $client->update_city($city); } $client->upload_avatar(); show_confirmation(T_('User Updated'), $client->fullname . "(" . $client->username . ")" . T_('updated'), AmpConfig::get('web_path') . '/admin/users.php'); break; case 'add_user': if (AmpConfig::get('demo_mode')) { break; } if (!Core::form_verify('add_user', 'post')) {
Country: Sherbrooke, Quebec, Canada Date : 1 juin 2015 --> <?php //include include '../../../controllers/account/User.php'; //Verify User in table /** * @var $error Error to send if have one */ $User = new User(); /**< Class User to change the password */ $error = '0'; /**< Error to send if have one */ if ($User->set_email_or_pseudo($_POST['email'])) { $error = $User->update_password($_POST['current_password'], $_POST['new_password']); } else { $error = "e-mail not found!"; } ?> // go to views result <script type="text/javascript"> var result = <?php echo json_encode($error); ?> ; window.location = "../../../views/account/change_password_result.php?change="+result;</script>';