Esempio n. 1
0
File: auth.php Progetto: nob/joi
 /**
  * get_user
  * Gets complete information about a given $username
  *
  * @param string  $username  Username to look up
  * @return Statamic_User object
  */
 public static function get_user($username)
 {
     $u = Statamic_User::load($username);
     return $u;
 }
Esempio n. 2
0
File: routes.php Progetto: nob/joi
     $data['email'] = $form_data['yaml']['email'];
     $data['roles'] = $form_data['yaml']['roles'];
     $data['biography'] = $form_data['biography'];
     $data['original_name'] = $form_data['original_name'];
     $data['status_message'] = 'Creating new member';
     $template_list = array("member");
     Statamic_View::set_templates(array_reverse($template_list));
     $admin_app->render(null, array('route' => 'publish', 'app' => $admin_app) + $data);
     return;
 }
 // IF NOT ERRORS SAVE
 if (isset($form_data['new'])) {
     $user = new Statamic_User(array());
     $user->set_name($name);
 } else {
     $user = Statamic_User::load($name);
 }
 $user->set_first_name($form_data['yaml']['first_name']);
 $user->set_last_name($form_data['yaml']['last_name']);
 $user->set_email($form_data['yaml']['email']);
 if (!isset($form_data['yaml']['roles'])) {
     $form_data['yaml']['roles'] = '';
 }
 $user->set_roles($form_data['yaml']['roles']);
 $user->set_biography_raw($form_data['biography']);
 if (isset($form_data['yaml']['password']) && $form_data['yaml']['password'] != '') {
     $user->set_password($form_data['yaml']['password'], true);
 }
 $user->save();
 // Rename?
 if (!isset($form_data['new'])) {