public function do_actions()
 {
     #/*
     # * Fetch the data on the admin users.
     # */
     #$user_entries = Admin_UsersHelper::get_all_user_entries();
     #
     #/*
     # * Preprocess the user data.
     # */
     #$preprocessed_users = array();
     #
     #foreach ($user_entries as $user_entry) {
     #	$preprocessed_users[]
     #		= array(
     #			'name' => $user_entry->get_name(),
     #			'email' => $user_entry->get_email(),
     #			'real_name' => $user_entry->get_real_name(),
     #			'type' => $user_entry->get_type()
     #		);
     #}
     #
     #/*
     # * Print of the data.
     # */
     #CLIScripts_DataRenderingHelper
     #	::render_array_of_assocs_in_table(
     #		$preprocessed_users
     #	);
     $user_assocs = array();
     foreach (Admin_UsersHelper::get_all_user_entries() as $user_entry) {
         $user_assocs[] = $user_entry->get_assoc();
     }
     CLIScripts_DataRenderingHelper::render_array_of_assocs_in_table($user_assocs, array('id' => 'ID'));
 }
 public function do_actions()
 {
     $user_assocs = array();
     foreach (Admin_UsersHelper::get_all_user_entries() as $user_entry) {
         $user_assocs[] = $user_entry->get_assoc();
     }
     CLIScripts_DataRenderingHelper::render_array_of_assocs_in_table($user_assocs, array('id' => 'ID'));
 }
 public function do_actions()
 {
     /*
      * Get the user's choice of user.
      */
     $chosen_user = Admin_UsersHelper::get_user_entry_from_cli_choice();
     /*
      * Reset the password.
      */
     $chosen_user->reset_password();
 }
 public function do_actions()
 {
     /*
      * Get the user's choice of user.
      */
     $chosen_user = Admin_UsersHelper::get_user_entry_from_cli_choice();
     /*
      * Show the data of the user.
      */
     $chosen_user->show_data_on_cli();
 }
예제 #5
0
 public function indexAction()
 {
     if ($this->getRequest()->getPost('user') == '' || $this->getRequest()->getPost('pass') == '') {
         $this->getResponse()->setStatus(0)->setBody(__('Enter username and password'))->toJson();
     }
     /*if (!Core_LinkExploit::checkOnce($this->getRequest()->getPost('token'), 'login')) {
     			$this->getResponse()->setStatus(0)->setBody(__('Invalid Data Submitted'))->toJson();
     		}*/
     $user_rs = Admin_UsersModel::get(array('user' => $this->getRequest()->getPost('user'), 'password' => Core_Security::generate($this->getRequest()->getPost('pass'))));
     if (!$user_rs) {
         $this->getResponse()->setStatus(0)->setBody(__('Wrong username and/or password'))->toJson();
     }
     // now login the user
     if (Admin_UsersHelper::login($user_rs->id)) {
         $this->getResponse()->setStatus(1)->toJson();
     }
 }
 public function do_actions()
 {
     Admin_UsersHelper::reset_all_users_passwords();
 }
 public function show_data_on_cli()
 {
     Admin_UsersHelper::show_user_data_on_cli($this);
 }
 public static function get_user_entry_from_cli_choice()
 {
     /*
      * Get the array of users.
      */
     $all_user_entries = Admin_UsersHelper::get_all_user_entries();
     /*
      * Do a bit of array manipulation to put users
      * into a hash with the names as the key.
      */
     $users_hash = array();
     foreach ($all_user_entries as $user_entry) {
         $users_hash[$user_entry->get_name()] = $user_entry;
     }
     /*
      * Get the user's choice of user.
      */
     return $users_hash[CLIScripts_UserInterrogationHelper::get_choice_from_string_array(array_keys($users_hash))];
 }
 public function do_actions()
 {
     Admin_UsersHelper::delete_all_users();
 }