本文整理汇总了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();