Ejemplo n.º 1
0
 /**
  * show the user their profile for editing
  *
  * @return void
  * @author Andy Bennett
  */
 public function profile()
 {
     if (!$this->model->test_logged_in()) {
         throw new Exception('invalid user');
     }
     $id = $this->model->get_user_data()->id;
     $setup = steamcore::array_object(array('update' => $id, 'form_name' => 'auth_profile', 'model' => $this->model));
     // try running the form, throw exception on error (shouldn't happen)
     try {
         steamform_helper::run_form($setup);
     } catch (Exception $e) {
         throw new Kohana_User_Exception('SteamCore Edit Error', $e->getMessage());
     }
 }
Ejemplo n.º 2
0
 /**
  * add
  *
  * @param object $setup 
  * @return void
  * @author Andy Bennett
  */
 public function add($setup = false)
 {
     // check if user has permission to edit
     $data = array('action' => 'add', 'name' => $this->name, 'role' => Steamauth::instance()->get_role());
     Event::run('steamcore.aclcheck', $data);
     // set up the defaults
     $d = array('model' => $this->model, 'form_name' => $this->setup['name'] . '_add', 'form_data' => array());
     $setup = steamcore::array_object($d, $setup);
     // try running the form, throw exception on error (shouldn't happen)
     try {
         steamform_helper::run_form($setup);
     } catch (Exception $e) {
         throw new Kohana_User_Exception('SteamCore Add Error', $e->getMessage());
     }
 }