本文整理汇总了PHP中auth::instance方法的典型用法代码示例。如果您正苦于以下问题:PHP auth::instance方法的具体用法?PHP auth::instance怎么用?PHP auth::instance使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类auth
的用法示例。
在下文中一共展示了auth::instance方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: form_setup
/**
*
* formmanager definitions
*
*/
public function form_setup($form)
{
$form->fields['id_user']['value'] = auth::instance()->get_user()->id_user;
$form->fields['id_user']['display_as'] = 'hidden';
$form->fields['seotitle']['display_as'] = 'hidden';
$form->fields['id_forum']['display_as'] = 'select';
$form->fields['id_forum']['caption'] = 'name';
}
示例2: log
/**
* Adds a new Log Message.
*
* MLog::add($user,'SUCCESS','Login','Yeah it works!');
*
* @param ORM Model
* @param string Status
* @param string Type
* @param string message
* @return void
*/
static function log(ORM $model, $category, $status, $type, $subject, $body = '')
{
$user_id = '';
if (auth::instance()->logged_in())
{
$user_id = auth::instance()->get_user()->pk();
}
$additional_data = array(
'category' => $category,
'status' => $status,
'type' => $type,
'subject' => $subject,
'body' => $body,
'user_id' => $user_id,
'client_ip' => Request::$client_ip,
);
return static::factory($model, 'mlog')->add_item($additional_data);
}
示例3: action_logout
public function action_logout()
{
auth::instance()->logout();
$this->request->redirect('kadldap');
}
示例4:
<dl>
<dt>Kadldap::all_contacts()</dt>
<dd><?php
echo kohana::debug($kadldap->all_contacts());
?>
</dd>
<dt>all_distribution_groups</dt>
<dd><?php
echo kohana::debug($kadldap->all_distribution_groups());
?>
</dd>
<dt>get_account_suffix</dt>
<dd><?php
echo kohana::debug($kadldap->get_account_suffix());
?>
</dd>
<dt>Kadldap::user_info($username)</dt>
<dd><?php
echo kohana::debug($kadldap->user_info(auth::instance()->get_user()));
?>
</dd>
<dt>Kadldap::user_groups($username)</dt>
<dd><?php
echo kohana::debug($kadldap->user_groups(auth::instance()->get_user()));
?>
</dd>
</dl>
<?php
}