• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP Authority类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中Authority的典型用法代码示例。如果您正苦于以下问题:PHP Authority类的具体用法?PHP Authority怎么用?PHP Authority使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了Authority类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: json

 function json()
 {
     $this->requiring();
     $authority = new Authority();
     $authorized = $authority->authorize();
     if ($authorized !== true) {
         die('認証に失敗しました。ログインし直してください。');
     } else {
         return $this->execute();
     }
 }
开发者ID:rochefort8,项目名称:tt85,代码行数:11,代码来源:controller.php


示例2: update

 /**
  * We can override a method to add, for example, authorisation
  */
 public function update($id)
 {
     if (Authority::cannot('update', 'product', $id)) {
         return Response::json(array('message' => 'You are not allowed to update this product'), 401);
     }
     parent::update($id);
 }
开发者ID:vespakoen,项目名称:epi,代码行数:10,代码来源:ProductController.php


示例3: login

    /**
     * Logs one user on the admin panel
     *
     */
    public function login()
    {
        $default_admin_lang = Settings::get_default_admin_lang();
        // TODO :
        // - Replace by : config_item('uri_lang_code');
        // - Remove / Rewrite Settings::get_uri_lang()
        $uri_lang = Settings::get_uri_lang();
        // If the user is already logged and if he is in the correct minimum group, go to Admin
        if (User()->logged_in() && Authority::can('access', 'admin')) {
            redirect(base_url() . $uri_lang . '/' . config_item('admin_url'));
        }
        if (User()->logged_in() && !Authority::can('access', 'admin')) {
            redirect(base_url());
        }
        if (!empty($_POST)) {
            unset($_POST['submit']);
            if ($this->_try_validate_login()) {
                // User can log with email OR username
                if (strpos($_POST['username'], '@') !== FALSE) {
                    $email = $_POST['username'];
                    unset($_POST['username']);
                    $_POST['email'] = $email;
                }
                try {
                    User()->login($_POST);
                    redirect(base_url() . $uri_lang . '/' . config_item('admin_url') . '/auth/login');
                } catch (Exception $e) {
                    $this->login_errors = $e->getMessage();
                }
            } else {
                $this->login_errors = lang('ionize_login_error');
            }
        } else {
            if ($this->is_xhr()) {
                $html = '
					<script type="text/javascript">
						var url = "' . config_item('admin_url') . '";
						top.location.href = url;
					</script>';
                echo $html;
                exit;
                /*
                // Save options : as callback
                				$this->callback[] = array(
                	'fn' => 'ION.reload',
                	'args' => array('url'=> config_item('admin_url'))
                );
                $this->response();
                */
            } else {
                if (!in_array($uri_lang, Settings::get('displayed_admin_languages')) or $uri_lang != $default_admin_lang) {
                    redirect(base_url() . $default_admin_lang . '/' . config_item('admin_url') . '/auth/login');
                }
            }
        }
        $this->output('auth/login');
    }
开发者ID:pompalini,项目名称:emngo,代码行数:61,代码来源:auth.php


示例4: _initialize

 public function _initialize()
 {
     header("Content-Type:text/html; charset=utf-8");
     import('ORG.Util.Authority');
     //加载类库
     $auth = new Authority();
     //后台 admin_name
     $uid = $this->_session('admin_uid');
     $user = $this->_session('admin_name');
     $prompt = $uid ? "你没有权限" : "请登陆";
     $url = $uid ? "" : "__ROOT__/Admin/Logo.html";
     if ($user != "admin") {
         if (!$auth->getAuth(GROUP_NAME . '/' . MODULE_NAME . '/' . ACTION_NAME, $uid)) {
             //echo $user;
             $this->error($prompt, $url);
         }
     }
     $system = $this->systems();
     $this->assign('s', $system);
 }
开发者ID:chenyongze,项目名称:Dswjcms,代码行数:20,代码来源:AdminCommAction.class.php


示例5: index

 /**
  * Tree init.
  * Displays the tree view, which will call each menu tree builder
  *
  */
 public function index()
 {
     // TODO : Limit the number of displayed articles in the tree
     // $nb_elements = $this->page_model->count_all() + $this->article_model->count_all();
     if (Authority::can('access', 'admin/tree')) {
         // Menus : All menus
         $menus = $this->menu_model->get_list(array('order_by' => 'ordering ASC'));
         $this->template['menus'] = $menus;
         $this->output('tree/tree');
     }
 }
开发者ID:pompalini,项目名称:emngo,代码行数:16,代码来源:tree.php


示例6: update

 /**
  * Update one menu
  *
  */
 public function update()
 {
     $id = $this->input->post('id_menu');
     if ($id) {
         $this->menu_model->update($id, $this->input->post());
         if (Authority::can('access', 'admin/menu/permissions/backend')) {
             $resource = 'backend/menu/' . $id;
             $this->rule_model->save_element_roles_rules($resource, $this->input->post('backend_rule'));
         }
     }
     // UI update panels
     $this->_update_panels();
     $this->success(lang('ionize_message_menu_updated'));
 }
开发者ID:pompalini,项目名称:emngo,代码行数:18,代码来源:menu.php


示例7: tag_authority_can

 /**
  * @param FTL_Binding $tag
  *
  * @return string
  */
 public static function tag_authority_can(FTL_Binding $tag)
 {
     $action = $tag->getAttribute('action');
     $resource = $tag->getAttribute('resource');
     if (empty($action) && empty($resource)) {
         return self::show_tag_error($tag, 'Feed the "action" and "resource" attributes');
     }
     if (Authority::can($action, $resource)) {
         return $tag->expand();
     } else {
         // Else
         self::$trigger_else++;
     }
     return '';
 }
开发者ID:pompalini,项目名称:emngo,代码行数:20,代码来源:Authority.php


示例8: get_field_list

 /**
  * Returns one definition fields list
  *
  *
  */
 function get_field_list()
 {
     $fields = array();
     if (Authority::can('edit', 'admin/item/definition')) {
         $id_definition = $this->input->post('id_item_definition');
         $fields = $this->extend_field_model->get_lang_list(array('parent' => 'item', 'id_parent' => $id_definition), Settings::get_lang('default'));
     }
     //
     $this->template['id_item_definition'] = $id_definition;
     $this->template['fields'] = $fields;
     $this->output('item/definition/fields');
 }
开发者ID:pompalini,项目名称:emngo,代码行数:17,代码来源:item_definition.php


示例9: function

</ul>


<script type="text/javascript">

	/**
	 * Types list itemManager
	 *
	 */
	typesManager = new ION.ItemManager({ element: 'article_type', container: 'article_typeList' });
	
	typesManager.makeSortable();

	<?php 
if (Authority::can('edit', 'admin/article/type')) {
    ?>
		// Type editable
		$$('#article_typeList .title').each(function(item, idx)
		{
			var id = item.getProperty('data-id');

			item.addEvent('click', function(e){
				ION.formWindow('article_type' + id, 'article_typeForm' + id, Lang.get('ionize_title_type_edit'), 'article_type/edit/' + id);
			});
		});
	<?php 
}
?>

</script>
开发者ID:pompalini,项目名称:emngo,代码行数:30,代码来源:article_list.php


示例10: function

			mediaManager.toggleFileManager();
		});

		// Init the staticItemManager
		staticItemManager.init({
			'parent': 'article',
			'id_parent': id_article,
			'parentListContainer': 'articleTab'
		});

		// Get Static Items
		staticItemManager.getParentItemList();

		// Add video button
		<?php 
    if (Authority::can('link', 'admin/page/media')) {
        ?>

			$('btnAddVideoUrl').addEvent('click', function()
			{
				ION.dataWindow(
					'addExternalMedia',
					'ionize_label_add_video',
					'media/add_external_media_window',
					{width:600, height:150},
					{
						'parent': 'article',
						'id_parent': id_article
					}
				)
			});
开发者ID:rockylo,项目名称:ionize,代码行数:31,代码来源:article.php


示例11: function

require __DIR__ . DS . 'helpers' . EXT;
// --------------------------------------------------------------
// Load bundles
// --------------------------------------------------------------
//Bundle::start('thirdparty_dbmanager');
Bundle::start('thirdparty_bootsparks');
// --------------------------------------------------------------
// Load namespaces
// --------------------------------------------------------------
Autoloader::namespaces(array('Domain' => __DIR__));
// --------------------------------------------------------------
// Filters
// --------------------------------------------------------------
Route::filter('authority', function ($resource) {
    $action = Request::$route->parameters['0'];
    if (Authority::cannot($action, $resource)) {
        return Response::make('', 401);
    }
});
Route::filter('auth', function () {
    if (Auth::guest()) {
        return Redirect::make('', 401);
    }
});
// --------------------------------------------------------------
// Setting system tables
// --------------------------------------------------------------
DBManager::$hidden = Config::get('domain::dbmanager.hidden');
$api_version = Config::get('layla.domain.api.version');
// --------------------------------------------------------------
// Map the Base Controller
开发者ID:reith2004,项目名称:domain,代码行数:31,代码来源:start.php


示例12: function

		{
			ION.formWindow(
				'user', 					// Window ID
				'userForm',					// Form ID
				'ionize_title_add_user', 	// Window title
				'user/create',			// Window content URL
				{width: 400, resize:true}	// Window options
			);
		});

	<?php 
}
?>

	<?php 
if (Authority::can('create', 'admin/role')) {
    ?>

		// New Role
		$('newRoleToolbarButton').addEvent('click', function(e)
		{
			ION.formWindow(
				'role',
				'roleForm',
				'ionize_title_add_role',
				'role/create',
				{width: 420, resize:true}
			);
		});

	<?php 
开发者ID:pompalini,项目名称:emngo,代码行数:31,代码来源:users_toolbox.php


示例13: delete

 function delete($id = false)
 {
     Authority::is_logged_in();
     if (Authority::checkAuthority('Managecareer.delete') == true) {
         redirect('index.php/Loginpg');
     }
     $filter = array('career_id' => $id);
     $this->Careerpg_model->delete('career_detail', 'career_master', $filter);
     $this->session->set_flashdata('message_type', 'success');
     $this->session->set_flashdata('message', $this->config->item("index") . " Data deleted Successfully!!");
     $this->parser->parse('Adminheader', $this->data);
     $this->load->view('Mngcareer');
     $this->parser->parse('Adminfooter', $this->data);
     redirect('index.php/Careerpg/Mngcaindex');
 }
开发者ID:junctiontech,项目名称:careermitra,代码行数:15,代码来源:Careerpg.php


示例14: foreach

">

							<?php 
    foreach ($fields as $field) {
        ?>
								<li class="sortme element_field" data-id="<?php 
        echo $field['id_extend_field'];
        ?>
" id="element_field<?php 
        echo $field['id_extend_field'];
        ?>
">
									<span class="icon left drag"></span>

									<?php 
        if (Authority::can('edit', 'admin/element')) {
            ?>
										<a class="icon delete right" data-id="<?php 
            echo $field['id_extend_field'];
            ?>
"></a>
									<?php 
        }
        ?>

									<span class="lite right mr10" data-id="<?php 
        echo $field['id_extend_field'];
        ?>
">
										<?php 
        echo $field['type_name'];
开发者ID:trk,项目名称:ionize,代码行数:31,代码来源:definition.php


示例15: resolveLSID

function resolveLSID($l)
{
    global $config;
    $rdf = '';
    $xml = '<?xml version="1.0" encoding="utf-8" ?>' . "\n";
    $xml .= "<result>\n";
    $xml .= "<lsid>" . $l . "</lsid>\n";
    $lsid = new LSID($l);
    $proxy = '';
    if ($config['proxy_name'] != '') {
        $proxy = $config['proxy_name'] . ":" . $config['proxy_port'];
    }
    $authority = new Authority($proxy);
    $ok = false;
    if (!$lsid->isValid()) {
        $xml .= "<error>LSID is not validly formed</error>\n";
    } else {
        $ok = $authority->Resolve($l);
        if (!$ok) {
            $xml .= "<error>DNS lookup for " . $lsid->getAuthority() . " failed</error>\n";
        } else {
            $authority->GetAuthorityWSDL();
            $ok = $authority->GetHTTPBinding();
            if (!$ok) {
                $xml .= "<error>No HTTP binding found</error>\n";
            }
            $ok = $authority->GetServiceWSDL($l);
            if (!$ok) {
                $xml .= "<error>Error retrieving service WSDL</error>";
            } else {
                $authority->GetMetadataHTTPLocation();
                $rdf = $authority->GetHTTPMetadata($l);
                $ok = $rdf != '';
            }
        }
    }
    if ($ok) {
        return $rdf;
    } else {
        $xml .= "<error_codes" . " HTTP=\"" . $authority->http_code . "\"" . " LSID=\"" . $authority->lsid_code . "\"" . " CURL=\"" . $authority->curl_code . "\"" . " />\n";
        $xml .= "</result>\n";
        return $xml;
    }
}
开发者ID:rdmpage,项目名称:bioguid,代码行数:44,代码来源:class_lsid.php


示例16: selectlist

     $sel = new selectlist('Instrument_Type_ID', $inst->getInstrumentTypeList(), 'Select Instrument Type', 'Instrument_Type_ID', 'Instrument', 'class="required"', '', '');
     break;
 case 'skillgroup':
     //machine list
     $sg = new SkillGroup();
     $sg->createSkillGroupList();
     if (isset($_GET['class'])) {
         $class = 'class="required"';
     } else {
         $class = '';
     }
     $sel = new selectlist('Skill_Group_ID', $sg->getSkillGroupList(), 'Select Skill Group', 'Skill_Group_ID', 'Group_Desc', $class, '', '1');
     break;
 case 'auth':
     //machine list
     $au = new Authority();
     $au->createAuthorityList();
     $sel = new selectlist('Authority_ID', $au->getAuthorityList(), 'Select Authority Group', 'Authority_ID', 'Authority', '', '', '1');
     break;
 case 'approval':
     //machine list
     $app = new Approval();
     $app->setValue('skillgroup', $_GET['sgid']);
     $app->createApprovarList();
     $sel = new selectlist('Approver_ID', $app->getApprovarList(), 'Select Approver', 'Operator_ID', 'Operator_Name', '', '', '1');
     break;
 case 'idle':
     //machine list
     $act = new Activitylog();
     $act->createReasonList();
     $sel = new selectlist('Idle_ID', $act->getReasonList(), 'Select Idle Reason', 'Idle_ID', 'Idle_Reason', 'class="required"', '', '1');
开发者ID:sknagesh,项目名称:divyaeng2,代码行数:31,代码来源:class.selectlist.php


示例17: lang

    ?>
						<?php 
    if (Authority::can('access', 'admin/settings/website')) {
        ?>
							<li class="divider"><a class="navlink" href="setting" title="<?php 
        echo lang('ionize_menu_site_settings');
        ?>
"><?php 
        echo lang('ionize_menu_site_settings');
        ?>
</a></li>
						<?php 
    }
    ?>
						<?php 
    if (Authority::can('access', 'admin/settings/technical')) {
        ?>
							<li><a class="navlink" href="setting/technical" title="<?php 
        echo lang('ionize_menu_site_settings_technical');
        ?>
"><?php 
        echo lang('ionize_menu_site_settings_technical');
        ?>
</a></li>
						<?php 
    }
    ?>
					</ul>
				</li>
			<?php 
}
开发者ID:rockylo,项目名称:ionize,代码行数:31,代码来源:desktop_header.php


示例18: lang

">

		<p class="lite"><?php 
echo lang('ionize_help_notify_user_account_updated');
?>
</p>

		<textarea name="message" class="autogrow"></textarea>

	</div>

</form>

<div class="buttons">
	<?php 
if (Authority::can('edit', 'admin/user')) {
    ?>
		<button id="bSaveuser<?php 
    echo $user['id_user'];
    ?>
" type="button" class="button yes right"><?php 
    echo lang('ionize_button_save_close');
    ?>
</button>
	<?php 
}
?>
	<button id="bCanceluser<?php 
echo $user['id_user'];
?>
"  type="button" class="button no right"><?php 
开发者ID:pompalini,项目名称:emngo,代码行数:31,代码来源:user.php


示例19: unlock_publish_filter

 /**
  * Switch the publish filter off
  *
  */
 public function unlock_publish_filter()
 {
     $uri_string_to_array = explode('/', preg_replace("|^\\/?|", '/', self::$ci->uri->uri_string));
     if (!in_array(config_item('admin_url'), $uri_string_to_array)) {
         // Settings::get('display_front_offline_content') not available here
         $this->{$this->db_group}->where('name', 'display_front_offline_content');
         $query = $this->{$this->db_group}->get('setting');
         $result = $query->row_array();
         if (Authority::can('access', 'admin') && (!empty($result['content']) && $result['content'] == '1')) {
             self::$publish_filter = FALSE;
         }
     } else {
         self::$publish_filter = FALSE;
     }
 }
开发者ID:rockylo,项目名称:ionize,代码行数:19,代码来源:base_model.php


示例20: get_base_url

 public static function get_base_url()
 {
     if (Authority::can('access', 'admin') && Settings::get('display_front_offline_content') == 1) {
         Settings::set_all_languages_online();
     }
     if (count(Settings::get_online_languages()) > 1) {
         return base_url() . Settings::get_lang() . '/';
     }
     return base_url();
 }
开发者ID:pompalini,项目名称:emngo,代码行数:10,代码来源:Tagmanager.php



注:本文中的Authority类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP Authorization类代码示例发布时间:2022-05-23
下一篇:
PHP AuthorPeer类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap