当前位置: 首页>>代码示例>>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;未经允许,请勿转载。