本文整理汇总了PHP中checkAccessThrowException函数的典型用法代码示例。如果您正苦于以下问题:PHP checkAccessThrowException函数的具体用法?PHP checkAccessThrowException怎么用?PHP checkAccessThrowException使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了checkAccessThrowException函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: init
public function init()
{
parent::init();
// Check Access
checkAccessThrowException('op_payroll_payments_view');
// Add Breadcrumb
$this->addBreadCrumb(at('Employee\'s Salaries'));
$this->title[] = at('Employee\'s Salaries');
}
示例2: init
public function init()
{
parent::init();
// Check Access
checkAccessThrowException('op_payroll_standard_salary_view');
// Add Breadcrumb
$this->addBreadCrumb(at('Standard Salary'));
$this->title[] = at('Standard Salary');
}
示例3: init
public function init()
{
parent::init();
// Check Access
checkAccessThrowException('op_reference_districts_view');
// Add Breadcrumb
$this->addBreadCrumb(at('Geography'));
$this->addBreadCrumb(at('Districts'));
$this->title[] = at('Districts');
}
示例4: init
/**
* init
*/
public function init()
{
// Check Access
checkAccessThrowException('op_media_view');
// Make sure uploads directory is set
if (!getParam('uploads_dir')) {
throw new CHttpException(500, Yii::t('media', 'Sorry, You must set the uploads directory first. From the top menu Go to Tools -> Settings -> Missing Settings.'));
}
parent::init();
// Add Breadcrumb
$this->addBreadCrumb(at('Media Manager'));
$this->title[] = at('Media Manager');
}
示例5: actionLoginHistory
/**
* User manager index
*/
public function actionLoginHistory()
{
// Check Access
checkAccessThrowException('op_loginhistory_view');
$model = new AdminLoginHistory('search');
$model->unsetAttributes();
if (isset($_GET['AdminLoginHistory'])) {
$model->attributes = $_GET['AdminLoginHistory'];
}
// Add Breadcrumb
$this->addBreadCrumb(at('Login History'));
$this->title[] = at('Admin Login History');
$this->render('login_history', array('model' => $model));
}
示例6: actionIndex
public function actionIndex()
{
// Submitted form
if (isset($_POST['dashboard_staff_message'])) {
// Check access
checkAccessThrowException('op_dashboard_update_staff_message');
// Update message
Setting::model()->updateSettingByKey('dashboard_staff_message', $_POST['dashboard_staff_message']);
// Log Message
alog(at("Updated Staff Message"));
// Updated redirect
fok(at('Message Saved.'));
$this->redirect(array('index'));
}
$logModel = new AdminLog();
$this->render('index', array('logModel' => $logModel));
}
示例7: actionAddItemChild
/**
* adding auth item child relationships
*/
public function actionAddItemChild()
{
// Check Access
checkAccessThrowException('op_permission_add_item_child');
$model = new AuthItemChild();
$roles = AuthItem::model()->findAll(array('order' => 'type DESC, name ASC'));
$_roles = array();
if (count($roles)) {
foreach ($roles as $role) {
$_roles[AuthItem::model()->types[$role->type]][$role->name] = $role->description . ' (' . $role->name . ')';
}
}
// Did we choose a parent already?
if (isset($_GET['parent']) && $_GET['parent'] != '') {
$model->parent = $_GET['parent'];
}
if (isset($_POST['AuthItemChild'])) {
if (isset($_POST['AuthItemChild']['child']) && count($_POST['AuthItemChild']['child'])) {
// We need to delete all child items selected up until now
$existsalready = AuthItemChild::model()->findAll('parent=:parent', array(':parent' => $model->parent));
if (count($existsalready)) {
foreach ($existsalready as $existitem) {
Yii::app()->authManager->removeItemChild($existitem->parent, $existitem->child);
}
}
$added = 0;
foreach ($_POST['AuthItemChild']['child'] as $childItem) {
$model->child = $childItem;
if ($model->validate()) {
$added++;
}
}
// Get model parent
$authItem = AuthItem::model()->find('name=:name', array(':name' => $model->parent));
fok(at('{number} Child item(s) Added.', array('{number}' => $added)));
// Log Message
alog(at("Added {number} child items for {name}", array('{number}' => $added, '{name}' => $model->parent)));
if ($authItem) {
$this->redirect(array('view', 'id' => $authItem->id, '#' => 'tabs-2'));
} else {
$this->redirect(array('index'));
}
}
}
// Selected values
$selected = AuthItemChild::model()->findAll('parent=:parent', array(':parent' => $model->parent));
$_selected = array();
if (count($selected)) {
foreach ($selected as $select) {
$_selected[] = $select->child;
}
}
$model->child = $_selected;
// Add Breadcrumb
$this->addBreadCrumb(at('Adding Child Permissions'));
$this->title[] = at('Adding Child Permissions');
$this->render('child_form', array('model' => $model, 'roles' => $_roles));
}
示例8: actionSync
/**
* Sync theme
*/
public function actionSync($id)
{
// Check Access
checkAccessThrowException('op_theme_sync');
if ($model = Theme::model()->findByPk($id)) {
$total = $model->SyncTheme();
alog(at("Synced Theme '{name}'.", array('{name}' => $model->name)));
fok(at('Theme Synced. Total {n} files synced.', array('{n}' => $total)));
$this->redirect(array('themes/index'));
} else {
$this->redirect(array('themes/index'));
}
}
示例9: actionDelete
/**
* Delete user
*/
public function actionDelete($id)
{
// Check Access
checkAccessThrowException('op_users_delete');
$model = User::model()->findByPk($id);
if ($model) {
// Log Message
alog(at("Deleted user: '{name}'.", array('{name}' => $model->name)));
$model->delete();
fok(at('User Deleted!'));
} else {
throw new CHttpException(404, at('Sorry, That record was not found.'));
}
}
示例10: actionDelete
/**
* Delete city action
*/
public function actionDelete()
{
// Check Access
checkAccessThrowException('op_uscities_deletepages');
if (isset($_GET['id']) && ($model = USCity::model()->findByPk($_GET['id']))) {
alog(at("Deleted City Record '{name}'.", array('{name}' => $model->city_name)));
$model->delete();
fok(at('City Record Deleted.'));
$this->redirect(array('city/index'));
} else {
$this->redirect(array('city/index'));
}
}
示例11: actionDelete
/**
* Delete help topic action
*/
public function actionDelete()
{
// Check Access
checkAccessThrowException('op_helptopics_delete');
if (isset($_GET['id']) && ($model = HelpTopic::model()->findByPk($_GET['id']))) {
alog(at("Deleted Help Topic '{name}'.", array('{name}' => $model->name)));
$model->delete();
fok(at('Help Topic Deleted.'));
$this->redirect(array('helptopics/index'));
} else {
$this->redirect(array('helptopics/index'));
}
}
示例12: actionDelete
/**
* Delete page action
*/
public function actionDelete()
{
// Check Access
checkAccessThrowException('op_blog_deleteposts');
if (isset($_GET['id']) && ($model = BlogPost::model()->findByPk($_GET['id']))) {
alog(at("Deleted Blog Post '{name}'.", array('{name}' => $model->title)));
$model->delete();
fok(at('Page Deleted.'));
$this->redirect(array('blog/index'));
} else {
$this->redirect(array('blog/index'));
}
}
示例13: actionRevert
/**
* Revert a string to it's original form
*/
public function actionRevert()
{
// Check Access
checkAccessThrowException('op_language_translate');
$id = getRParam('id', 0);
$string = getRParam('string', 0);
// Check if it exists
$model = Language::model()->findByPk($id);
if (!$model) {
ferror(at('That language was not found.'));
$this->redirect(array('index'));
}
// Grab the string and source
$source = SourceMessage::model()->findByPk($string);
$stringdata = Message::model()->find('language_id=:lang AND id=:id', array(':id' => $string, ':lang' => $id));
if (!$source || !$stringdata) {
ferror(at('That language string was not found.'));
$this->redirect(array('index'));
}
// Update the stringdata based on the soruce
Message::model()->updateAll(array('translation' => $source->message), 'language_id=:lang AND id=:id', array(':id' => $string, ':lang' => $id));
fok(at('String Reverted.'));
$this->redirect(array('language/view', 'id' => $id));
}
示例14: init
public function init()
{
parent::init();
// Check Access
checkAccessThrowException('op_ajax_masters_employees_view');
}
示例15: actionDelete
/**
* Delete Form Template action
*/
public function actionDelete()
{
// Check Access
checkAccessThrowException('op_formtemplate_delete');
if (isset($_GET['id']) && ($model = FormTemplate::model()->findByPk($_GET['id']))) {
alog(at("Deleted Form Template '{name}'.", array('{name}' => $model->title)));
$model->delete();
fok(at('Form Template Deleted.'));
$this->redirect(array('formtemplate/index'));
} else {
$this->redirect(array('formtemplate/index'));
}
}