コード例 #1
0
 /**
  * constructor, acl check
  *
  * @author Andy Bennett
  */
 function __construct()
 {
     parent::__construct();
     parent::init();
     Acl::instance()->redirect(steamauth_helper::get_role(), 'admin');
     Display::instance()->set_template('template-admin');
 }
コード例 #2
0
 /**
  * constructor, check acl
  *
  * @author Andy Bennett
  */
 function __construct()
 {
     parent::__construct();
     parent::init();
     Acl::instance()->redirect(steamauth_helper::get_role(), 'admin');
     Display::instance()->append_data('page_id', 'containers-admin');
     Display::instance()->set_template('template-admin');
 }
コード例 #3
0
 /**
  * email a reset credential link to the a user
  *
  * @param object $fc 
  * @return void
  * @author Andy Bennett
  */
 public function forgotten_credential($fc)
 {
     $this->prep_formdata($fc);
     // check that a user with the passed email exists
     $data = $fc->data[$this->table];
     $this->db->select('*')->from($this->table);
     $this->db->where(array('email' => $data['email'], 'activated' => 1));
     $q = $this->db->get();
     if (!$q->count()) {
         throw new Exception('<span class="form-error">' . Kohana::lang('auth.no_matching_email') . '</span>');
     }
     //generates the activation code
     $forgotten_credential_code = steamauth_helper::generate_random_string(10, 10);
     // updates the user table with the code
     $sql = 'UPDATE ' . $this->table . ' SET `forgotten_credential_code`="' . $forgotten_credential_code . '" WHERE `id`="' . $q->current()->id . '"';
     $this->db->query($sql);
     // get the current segment array
     $uri = implode('/', array_slice(Kohana::instance()->uri->segment_array(), 0, -1));
     // get the column names
     $identity = $this->conf->identity_column;
     // run the email event
     $email_data = array('row' => $q->current(), 'forgotten_credential_code' => $forgotten_credential_code);
     Event::run('steamauth.forgotten_credential_email', $email_data);
     return true;
 }
コード例 #4
0
<?php

$u = isset($_GET['ajax']) ? '?ajax=true' : '';
?>
<div class="admin-item">
	<h3>
		<?php 
if (acl_helper::check_acl(steamauth_helper::get_role(), 'add')) {
    ?>
			<div class="flr">
				<?php 
    echo form::open('/' . $controller . '/add' . $u, '');
    ?>
				<?php 
    echo form::hidden('controller', $controller);
    ?>
				<?php 
    echo form::hidden('current', Kohana::instance()->uri->string() . $u);
    ?>
				<?php 
    echo assets::img_tag('/cache/img/admin/add_item.gif', array('alt' => 'Add', 'title' => 'Add an item'), true);
    ?>
				<?php 
    echo form::close();
    ?>
			</div>
		<?php 
}
?>
		<!--<?php 
echo ucfirst($controller);