public function process() { if (!$this->session->internal_users) { return; } list($success, $form) = $this->process_form(array('new_pass1', 'new_pass2', 'old_pass', 'change_password')); if ($success) { if ($form['new_pass1'] !== $form['new_pass2']) { Hm_Msgs::add("ERRNew passwords don't not match"); return; } $user = $this->session->get('username', false); if (!$this->session->auth($user, $form['old_pass'])) { Hm_Msgs::add("ERRCurrent password is incorrect"); return; } $user_config = load_user_config_object($this->config); if (!$this->session->change_pass($user, $form['new_pass1'])) { Hm_Msgs::add("ERRAn error Occurred"); } $user_config->load($user, $form['old_pass']); $user_config->save($user, $form['new_pass1']); } }
/** * @preserveGlobalState disabled * @runInSeparateProcess */ public function test_load_user_config_object() { /* TODO assertions */ load_user_config_object($this->config); $this->config->set('user_config_type', 'DB'); $this->assertEquals('Hm_User_Config_DB', get_class(load_user_config_object($this->config))); }
/** * @param objecty $config sit econfig * @return void */ public function __construct($config) { $this->site_config = $config; $this->user_config = load_user_config_object($config); $this->process_module_setup(); }