当前位置: 首页>>代码示例>>PHP>>正文


PHP UserUtils::clear_staff_modules_by_userID方法代码示例

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


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

示例1: foreach

 foreach ($first_names_array as $individual_name) {
     $initials .= trim(substr($individual_name, 0, 1));
 }
 // Update 'users' table.
 $tmp_roles = $_POST['roles'];
 $gender = $_POST['gender'];
 if ($gender == '') {
     $gender = NULL;
 }
 $result = $mysqli->prepare("UPDATE users SET roles = ?, title = ?, initials = ?, surname = ?, grade = ?, yearofstudy = ?, username = ?, email = ?, first_names = ?, gender = ? WHERE id = ?");
 $result->bind_param('sssssissssi', $tmp_roles, $_POST['title'], $initials, $_POST['surname'], $_POST['grade'], $_POST['year'], $_POST['username'], $_POST['email'], $_POST['first_names'], $gender, $userID);
 $result->execute();
 $result->close();
 // Remove from teams if 'left'.
 if (strtolower($tmp_roles) == 'left') {
     UserUtils::clear_staff_modules_by_userID($userID, $mysqli);
 }
 // Remove from admin access if role changed from Admin
 if ($userObject->has_role('SysAdmin')) {
     if ($tmp_roles != $_POST['prev_roles'] and $_POST['prev_roles'] == 'Staff,Admin') {
         UserUtils::clear_admin_access($userID, $mysqli);
     }
 }
 // Update 'sid' table;
 $result = $mysqli->prepare("DELETE FROM sid WHERE userID = ?");
 $result->bind_param('i', $userID);
 $result->execute();
 $result->close();
 if (isset($_POST['sid']) and $_POST['sid'] != '' and $_POST['sid'] != $string['unknown']) {
     $result = $mysqli->prepare("INSERT INTO sid VALUES (?, ?)");
     $result->bind_param('si', $_POST['sid'], $userID);
开发者ID:vinod-co,项目名称:centa,代码行数:31,代码来源:edit_details.php

示例2: check_var

// You should have received a copy of the GNU General Public License
// along with Rogō.  If not, see <http://www.gnu.org/licenses/>.
/**
* 
* @author Simon Wilkinson
* @version 1.0
* @copyright Copyright (c) 2014 The University of Nottingham
* @package
*/
require_once '../include/admin_auth.inc';
require_once '../include/errors.inc';
require_once '../classes/userutils.class.php';
$userID = check_var('userID', 'REQUEST', true, false, true);
if (isset($_POST['submit'])) {
    // Clear the team of all members.
    UserUtils::clear_staff_modules_by_userID($_POST['userID'], $mysqli);
    // Insert a record for each team member.
    for ($i = 0; $i < $_POST['module_no']; $i++) {
        if (isset($_POST["mod{$i}"]) and $_POST["mod{$i}"] != '') {
            UserUtils::add_staff_to_module($userID, $_POST["mod{$i}"], $mysqli);
        }
    }
    ?>
<html>
<head>
  <meta http-equiv="X-UA-Compatible" content="IE=edge" />
  <meta http-equiv="content-type" content="text/html;charset=<?php 
    echo $configObject->get('cfg_page_charset');
    ?>
" />
  <title><?php 
开发者ID:vinod-co,项目名称:centa,代码行数:31,代码来源:edit_multi_teams_popup.php


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