當前位置: 首頁>>代碼示例>>PHP>>正文


PHP mc_is_admin函數代碼示例

本文整理匯總了PHP中mc_is_admin函數的典型用法代碼示例。如果您正苦於以下問題:PHP mc_is_admin函數的具體用法?PHP mc_is_admin怎麽用?PHP mc_is_admin使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了mc_is_admin函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: submit

 public function submit()
 {
     $ip_false = M('option')->where("meta_key='ip_false' AND type='user'")->getField('meta_value', true);
     if ($ip_false && in_array(mc_user_ip(), $ip_false)) {
         $this->error('您的IP被永久禁止登陸!');
     } else {
         $user_name = mc_magic_in(mc_remove_html($_POST['user_name'], 'all'));
         if ($user_name == '') {
             $this->error('賬號必須填寫!');
         } else {
             $user_login = M('meta')->where("meta_key='user_name' AND type ='user'")->getField('meta_value', true);
             if (in_array(strip_tags($_POST['user_name']), $user_login)) {
                 $this->error('賬號已存在!');
             }
         }
         $user_email = mc_magic_in(mc_remove_html($_POST['user_email'], 'all'));
         if (empty($user_email)) {
             $this->error('郵箱必須填寫!');
         } else {
             $user_email = M('meta')->where("meta_key='user_email' AND type ='user'")->getField('meta_value', true);
             if (in_array(strip_tags($_POST['user_email']), $user_email)) {
                 $this->error('郵箱已存在!');
             }
         }
         if (empty($_POST['user_pass'])) {
             $this->error('密碼必須填寫!');
         }
         if ($_POST['user_pass'] != $_POST['user_pass2']) {
             $this->error('兩次密碼必須一致!');
         }
         $user['title'] = I('param.user_name');
         $user['content'] = '';
         $user['type'] = 'user';
         $user['date'] = strtotime("now");
         $result = M("page")->data($user)->add();
         if ($result) {
             mc_add_meta($result, 'user_name', $user_name, 'user');
             $user_pass = md5(I('param.user_pass') . mc_option('site_key'));
             mc_add_meta($result, 'user_pass', $user_pass, 'user');
             mc_add_meta($result, 'user_email', $user_email, 'user');
             mc_add_meta($result, 'user_level', '1', 'user');
             cookie('user_name', I('param.user_name'), 36000000000);
             cookie('user_pass', $user_pass, 36000000000);
             $ip_array = M('action')->where("page_id='" . mc_user_id() . "' AND action_key='ip'")->getField('action_value', true);
             if ($ip_array && in_array(mc_user_ip(), $ip_array)) {
             } else {
                 if (!mc_is_admin()) {
                     mc_add_action(mc_user_id(), 'ip', mc_user_ip());
                 }
             }
             if ($_POST['comefrom']) {
                 $this->success('注冊成功', $_POST['comefrom']);
             } else {
                 $this->success('注冊成功', U('user/index/edit?id=' . mc_user_id()));
             }
         } else {
             $this->error('注冊失敗');
         }
     }
 }
開發者ID:xiaowei521,項目名稱:vamshop,代碼行數:60,代碼來源:RegisterController.class.php

示例2: submit

 public function submit()
 {
     $ip_false = M('option')->where("meta_key='ip_false' AND type='user'")->getField('meta_value', true);
     if ($ip_false && in_array(mc_user_ip(), $ip_false)) {
         $this->error('您的IP被永久禁止登陸!');
     } else {
         $page_id = M('meta')->where("meta_key='user_name' AND meta_value='" . mc_magic_in(I('param.user_name')) . "' AND type='user'")->getField('page_id');
         $user_pass_true = mc_get_meta($page_id, 'user_pass', true, 'user');
         if ($_POST['user_name'] && $_POST['user_pass'] && md5($_POST['user_pass'] . mc_option('site_key')) == $user_pass_true) {
             $user_pass = md5(I('param.user_pass') . mc_option('site_key'));
             cookie('user_name', I('param.user_name'), 36000000000);
             cookie('user_pass', $user_pass, 36000000000);
             $ip_array = M('action')->where("page_id='" . mc_user_id() . "' AND action_key='ip'")->getField('action_value', true);
             if ($ip_array && in_array(mc_user_ip(), $ip_array)) {
             } else {
                 if (!mc_is_admin()) {
                     mc_add_action(mc_user_id(), 'ip', mc_user_ip());
                 }
             }
             if ($_POST['comefrom']) {
                 $this->success('登陸成功', $_POST['comefrom']);
             } else {
                 if (mc_is_mobile()) {
                     $this->success('登陸成功', U('user/index/pro?id=' . mc_user_id()));
                 } else {
                     $this->success('登陸成功', U('user/index/index?id=' . mc_user_id()));
                 }
             }
         } else {
             $this->error('用戶名與密碼不符!');
         }
     }
 }
開發者ID:xiaowei521,項目名稱:vamshop,代碼行數:33,代碼來源:LoginController.class.php

示例3: add_article

 public function add_article()
 {
     if (mc_is_admin() || mc_is_bianji()) {
         $this->theme(mc_option('theme'))->display('Publish/add_article');
     } else {
         $this->success('請先登陸', U('User/login/index'));
     }
 }
開發者ID:dalinhuang,項目名稱:shouzhangmall,代碼行數:8,代碼來源:IndexController.class.php

示例4: publish

 public function publish($id)
 {
     if (is_numeric($id)) {
         if (mc_is_admin()) {
             mc_update_page($id, 'publish', 'type');
             $this->success('審核成功!');
         } else {
             $this->error('您沒有權限訪問此頁麵!');
         }
     } else {
         $this->error('參數錯誤!');
     }
 }
開發者ID:xiaowei521,項目名稱:vamshop,代碼行數:13,代碼來源:IndexController.class.php

示例5: pending

 public function pending($page = 1)
 {
     if (mc_is_admin() || mc_is_bianji()) {
         $this->page = M('page')->where('type="pending"')->order('id desc')->page($page, mc_option('page_size'))->select();
         $count = M('page')->where('type="pending"')->count();
         $this->assign('id', $id);
         $this->assign('count', $count);
         $this->assign('page_now', $page);
         $this->theme(mc_option('theme'))->display('Post/pending');
     } else {
         $this->error('你沒有權限查看此頁麵!');
     }
 }
開發者ID:dalinhuang,項目名稱:shouzhangmall,代碼行數:13,代碼來源:GroupController.class.php

示例6: mc_pagenavi

">
							刪除
						</a>
					</div>
				</div>
			</div>
			<?php 
}
?>
		</div>
		<?php 
echo mc_pagenavi($count, $page_now, 30);
?>
	</div>
	<?php 
if (mc_is_admin()) {
    ?>
	<!-- Modal -->
	<div class="modal fade" id="addtermModal" tabindex="-1" role="dialog" aria-hidden="true">
		<div class="modal-dialog">
			<div class="modal-content">
				<div class="modal-header">
					
				</div>
				<form role="form" method="post" action="<?php 
    echo U('home/perform/publish_term');
    ?>
">
				<div class="modal-body">
					<div class="form-group">
						<label>
開發者ID:xiaowei521,項目名稱:vamshop,代碼行數:31,代碼來源:term.php

示例7: mc_pagenavi

">
							刪除
						</a>
					</div>
				</div>
			</div>
			<?php 
}
?>
		</div>
		<?php 
echo mc_pagenavi($count, $page_now, 30);
?>
	</div>
	<?php 
if (mc_is_admin() || mc_is_bianji()) {
    ?>
	<!-- Modal -->
	<div class="modal fade" id="addtermModal" tabindex="-1" role="dialog" aria-hidden="true">
		<div class="modal-dialog">
			<div class="modal-content">
				<div class="modal-header">
					
				</div>
				<form role="form" method="post" action="<?php 
    echo U('home/perform/publish_term');
    ?>
">
				<div class="modal-body">
					<div class="form-group">
						<label>
開發者ID:xiaowei521,項目名稱:vamshop,代碼行數:31,代碼來源:index.php

示例8: images

 public function images($page = 1)
 {
     if (mc_user_id()) {
         if (mc_is_admin()) {
             $this->content = M('attached')->order('id desc')->page($page, 20)->select();
             $count = M('page')->where($condition)->count();
             $this->assign('count', $count);
             $this->assign('page_now', $page);
             $this->theme(mc_option('theme'))->display('Control/images');
         } else {
             $this->error('您沒有權限訪問此頁麵!');
         }
     } else {
         $this->success('請先登陸', U('User/login/index'));
     }
 }
開發者ID:dalinhuang,項目名稱:shouzhangmall,代碼行數:16,代碼來源:IndexController.class.php

示例9: pro_down

 public function pro_down($id)
 {
     if (mc_is_admin() || mc_is_bianji()) {
         $pro_id = mc_prev_page_id($id);
         if ($pro_id > 0) {
             $date = mc_get_page_field($pro_id, 'date');
             $page['date'] = $date - 1;
             M('page')->where("id='{$id}' AND type='pro'")->save($page);
         }
         $this->success('操作成功!');
     } else {
         $this->error('請不要放棄治療');
     }
 }
開發者ID:xiaowei521,項目名稱:vamshop,代碼行數:14,代碼來源:PerformController.class.php

示例10: mc_template_part

					</div>
				</div>
				<?php 
    } else {
        ?>
				<?php 
        mc_template_part('sidebar');
        ?>
				<?php 
    }
    ?>
			</div>
		</div>
	</div>
	<?php 
    if (mc_is_admin() || mc_is_group_admin(mc_get_meta($val['id'], 'group'))) {
        ?>
	<!-- Modal -->
	<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
		<div class="modal-dialog modal-sm">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal" aria-hidden="true">
						&times;
					</button>
					<h4 class="modal-title" id="myModalLabel">
						
					</h4>
				</div>
				<div class="modal-body text-center">
					確認要刪除這篇文章嗎?
開發者ID:dalinhuang,項目名稱:shouzhangmall,代碼行數:31,代碼來源:index.php

示例11: ip_false

 public function ip_false($id)
 {
     if (is_numeric($id)) {
         if (mc_is_admin()) {
             if (mc_get_meta($id, 'user_level', true, 'user') != 10) {
                 $ip_array = M('action')->where("page_id='{$id}' AND action_key='ip'")->getField('action_value', true);
                 if ($ip_array) {
                     foreach ($ip_array as $ip) {
                         mc_add_option('ip_false', $ip, 'user');
                     }
                 }
                 mc_delete_page($id);
                 $this->success('操作成功', U('Home/index/index'));
             } else {
                 $this->error('請不要傷害管理員');
             }
         } else {
             $this->error('哥們,請不要放棄治療!', U('Home/index/index'));
         }
     } else {
         $this->error('參數錯誤!');
     }
 }
開發者ID:dalinhuang,項目名稱:shouzhangmall,代碼行數:23,代碼來源:PerformController.class.php

示例12: mysqlin

 public function mysqlin()
 {
     if (mc_is_admin()) {
         $fileName = THINK_PATH . '../db.php';
         if (!is_writeable($fileName)) {
             @chmod($fileName, 0777);
         }
         $json = file_get_contents($fileName);
         $mysqls = unserialize($json);
         foreach ($mysqls as $table => $mysql) {
             M($table)->data($mysql)->add();
         }
         $this->success('數據導入成功!', mc_site_url());
     } else {
         $this->error('凡人,請遠離是非之地!', mc_site_url());
     }
 }
開發者ID:xiaowei521,項目名稱:vamshop,代碼行數:17,代碼來源:IndexController.class.php

示例13: site_nav

 public function site_nav()
 {
     if (mc_is_admin()) {
         if ($_POST['nav_control']) {
             mc_add_option(I('param.nav_text'), I('param.nav_link'), 'nav');
             $this->success('保存成功', U('Home/index/index'));
         } else {
             $this->error('提交參數錯誤!');
         }
     } else {
         $this->success('請先登陸', U('User/login/index'));
     }
 }
開發者ID:dalinhuang,項目名稱:shouzhangmall,代碼行數:13,代碼來源:IndexController.class.php

示例14: add_topic

 public function add_topic()
 {
     if (mc_is_admin() || mc_is_bianji()) {
         $this->theme('admin')->display('Publish/add_topic');
     } else {
         $this->success('請先登陸', U('User/login/index'));
     }
 }
開發者ID:xiaowei521,項目名稱:vamshop,代碼行數:8,代碼來源:IndexController.class.php

示例15: add_weixin

 public function add_weixin()
 {
     if (mc_is_admin() && $_POST['fileup'] == 'ok') {
         $file_name = $_FILES['file']['name'];
         //獲取文件擴展名
         $temp_arr = explode(".", $file_name);
         $file_ext = array_pop($temp_arr);
         $file_ext = trim($file_ext);
         $file_ext = strtolower($file_ext);
         //創建文件
         $new_files = "./Public/weixin/" . $file_name;
         move_uploaded_file($_FILES["file"]["tmp_name"], $new_files);
         $filex = $new_files;
         $appid = mc_option('weixin_appid');
         $appsecret = mc_option('weixin_appsecret');
         $access_token = mc_get_access_token($appid, $appsecret);
         $callback = mc_upload_media($filex, $access_token);
         $this->assign('callback', $callback);
         $this->theme('admin')->display('Publish/add_weixin');
     } else {
         $this->error('未知錯誤!', U('home/index/index'));
     }
 }
開發者ID:xiaowei521,項目名稱:vamshop,代碼行數:23,代碼來源:WeixinController.class.php


注:本文中的mc_is_admin函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。