本文整理汇总了PHP中AWS_APP::model方法的典型用法代码示例。如果您正苦于以下问题:PHP AWS_APP::model方法的具体用法?PHP AWS_APP::model怎么用?PHP AWS_APP::model使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AWS_APP
的用法示例。
在下文中一共展示了AWS_APP::model方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct()
{
if (AWS_APP::session()->client_info and !$_COOKIE[G_COOKIE_PREFIX . '_user_login']) {
// Cookie 清除则 Session 也清除
unset(AWS_APP::session()->client_info);
}
if (!AWS_APP::session()->client_info and $_COOKIE[G_COOKIE_PREFIX . '_user_login']) {
$auth_hash_key = md5(G_COOKIE_HASH_KEY . $_SERVER['HTTP_USER_AGENT'] . $_SERVER['HTTP_ACCEPT_LANGUAGE']);
// 解码 Cookie
$sso_user_login = H::decode_hash($_COOKIE[G_COOKIE_PREFIX . '_user_login'], $auth_hash_key);
if ($sso_user_login['user_name'] and $sso_user_login['password'] and $sso_user_login['uid']) {
if (AWS_APP::model('account')->check_hash_login($sso_user_login['user_name'], $sso_user_login['password'])) {
AWS_APP::session()->client_info['__CLIENT_UID'] = $sso_user_login['uid'];
AWS_APP::session()->client_info['__CLIENT_USER_NAME'] = $sso_user_login['user_name'];
AWS_APP::session()->client_info['__CLIENT_PASSWORD'] = $sso_user_login['password'];
return true;
}
}
return false;
}
}
示例2: __construct
public function __construct()
{
if (AWS_APP::session()->client_info and !$_COOKIE[G_COOKIE_PREFIX . '_user_login']) {
// Cookie 清除则 Session 也清除
unset(AWS_APP::session()->client_info);
}
if (!AWS_APP::session()->client_info and $_COOKIE[G_COOKIE_PREFIX . '_user_login']) {
$auth_hash_key = md5(G_COOKIE_HASH_KEY . $_SERVER['HTTP_USER_AGENT'] . $_SERVER['HTTP_ACCEPT_LANGUAGE']);
// 解码 Cookie
$sso_user_login = H::decode_hash($_COOKIE[G_COOKIE_PREFIX . '_user_login'], $auth_hash_key);
$user_name = $sso_user_login['user_name'];
$host = 'localhost';
$username = 'root';
$password = 'toor';
$database = 'baji';
$dbc = mysqli_connect($host, $username, $password, $database);
if (!$dbc) {
die('Could not connect: ' . mysql_error());
}
$query = "SELECT * FROM users WHERE user_name = '{$user_name}'";
$data = mysqli_query($dbc, $query) or die('error!!' . mysql_error());
mysqli_close($dbc);
$row = mysqli_fetch_array($data);
$sso_user_login['password'] = $row['password'];
$sso_user_login['uid'] = $row['uid'];
$name = H::encode_hash($sso_user_login);
HTTP::set_cookie($name);
if ($sso_user_login['user_name'] and $sso_user_login['password'] and $sso_user_login['uid']) {
if (AWS_APP::model('account')->check_hash_login($sso_user_login['user_name'], $sso_user_login['password'])) {
AWS_APP::session()->client_info['__CLIENT_UID'] = $sso_user_login['uid'];
AWS_APP::session()->client_info['__CLIENT_USER_NAME'] = $sso_user_login['user_name'];
AWS_APP::session()->client_info['__CLIENT_PASSWORD'] = $sso_user_login['password'];
return true;
}
}
return false;
}
}
示例3: model
/**
* 调用系统 Model
*
* 于控制器中使用 $this->model('class')->function() 进行调用
*
* @access public
* @param string
* @return object
*/
public function model($model = null)
{
return AWS_APP::model($model);
}
示例4: get_weixin_rule_image
function get_weixin_rule_image($image_file, $size = '')
{
return AWS_APP::model('weixin')->get_weixin_rule_image($image_file, $size);
}
示例5: set_fold_action_history
public static function set_fold_action_history($answer_id, $fold = 1)
{
AWS_APP::model()->update('user_action_history', array('fold_status' => $fold), 'associate_type = ' . self::CATEGORY_ANSWER . ' AND associate_id = ' . intval($answer_id));
AWS_APP::model()->update('user_action_history', array('fold_status' => $fold), 'associate_type = ' . self::CATEGORY_QUESTION . ' AND associate_action = ' . self::ANSWER_QUESTION . ' AND associate_attached = ' . intval($answer_id));
if ($fold == 1) {
if ($action_history = AWS_APP::model()->fetch_all('user_action_history', 'associate_type IN(' . self::CATEGORY_QUESTION . ',' . self::CATEGORY_ANSWER . ') AND associate_action = ' . self::ANSWER_QUESTION . ' AND associate_attached = ' . intval($answer_id))) {
foreach ($action_history as $key => $val) {
AWS_APP::model()->delete('user_action_history_fresh', 'history_id = ' . $val['history_id']);
}
}
}
return $fold;
}