本文整理匯總了PHP中Notify::hasAccess方法的典型用法代碼示例。如果您正苦於以下問題:PHP Notify::hasAccess方法的具體用法?PHP Notify::hasAccess怎麽用?PHP Notify::hasAccess使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Notify
的用法示例。
在下文中一共展示了Notify::hasAccess方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: Notify
<?php
Ajax::requireLoggedIn();
$notify = new Notify($_GET['item']);
if (empty($notify->id) || !$notify->hasAccess()) {
Ajax::outputError('You don\'t have access to this notification');
}
$notifyName = trim($_GET['name']);
if (empty($notifyName)) {
Ajax::outputError('Notification name can\'t be empty');
}
/*if ($notifyName != $notify->name) {
if ($notify->notificationNameExists($notifyName)){
Ajax::outputError('Notification name already exists');
}
}*/
$notify->changeName($notifyName);
$out['id'] = $notify->id;
$out['name'] = $notify->name;
/*
$out = new stdClass();
$out->id = $notify->id;
$out->name = $notify->name;
*/
Ajax::output($out);
示例2: isset
<?php
ignore_user_abort(true);
set_time_limit(90);
$id = isset($_GET['id']) ? $_GET['id'] : null;
$state = isset($_GET['state']) ? $_GET['state'] : null;
$notify = new Notify($id);
if (!$notify->hasAccess()) {
Ajax::outputError('You don\'t have access to this notification');
}
if (!($json = $notify->getJSONContent())) {
Ajax::output('Could not generate default json params!');
}
//doar pe ON se mai poate pune
$params = json_decode($json, true);
$params['configs']['state'] = 'ON';
if (!$notify->updateJSON_Data($params)) {
Ajax::outputError('Could not update json params.');
}
//doar pe ON se mai poate pune
$notify->id = $id;
$notify->state = $state == 'ON';
$notify->save();