function get_buttons($user_id)
 {
     //	5/3/11
     $regs_viewed = "";
     if (isset($_SESSION['viewed_groups'])) {
         $regs_viewed = explode(",", $_SESSION['viewed_groups']);
     }
     $query2 = "SELECT * FROM `{$GLOBALS['mysql_prefix']}allocates` WHERE `type`= 4 AND `resource_id` = '{$user_id}' ORDER BY `group`";
     //	5/3/11
     $result2 = mysql_query($query2) or do_error($query2, 'mysql query failed', mysql_error(), basename(__FILE__), __LINE__);
     $al_buttons = "";
     while ($row2 = stripslashes_deep(mysql_fetch_assoc($result2))) {
         //	5/3/11
         if (!empty($regs_viewed)) {
             if (in_array($row2['group'], $regs_viewed)) {
                 $al_buttons .= "<DIV style='display: block;'><INPUT TYPE='checkbox' CHECKED name='frm_group[]' VALUE='{$row2['group']}'></INPUT>" . get_groupname($row2['group']) . "&nbsp;&nbsp;</DIV>";
             } else {
                 $al_buttons .= "<DIV style='display: block;'><INPUT TYPE='checkbox' name='frm_group[]' VALUE='{$row2['group']}'></INPUT>" . get_groupname($row2['group']) . "&nbsp;&nbsp;</DIV>";
             }
         } else {
             $al_buttons .= "<DIV style='display: block;'><INPUT TYPE='checkbox' CHECKED name='frm_group[]' VALUE='{$row2['group']}'></INPUT>" . get_groupname($row2['group']) . "&nbsp;&nbsp;</DIV>";
         }
     }
     //		dump($al_buttons);
     return $al_buttons;
 }
        $al_names .= "&nbsp;&nbsp;Superadmin Level";
    }
    if (isset($_SESSION['viewed_groups'])) {
        //	6/10/11
        $curr_viewed = explode(",", $_SESSION['viewed_groups']);
    } else {
        $curr_viewed = $al_groups;
    }
    $curr_names = "";
    //	6/10/11
    $z = 0;
    //	6/10/11
    foreach ($curr_viewed as $grp_id) {
        //	6/10/11
        $counter = count($curr_viewed) > $z + 1 ? ", " : "";
        $curr_names .= get_groupname($grp_id);
        $curr_names .= $counter;
        $z++;
    }
    $heading = "Add Ticket - " . get_variable('map_caption');
    if (get_num_groups() && COUNT(get_allocates(4, $_SESSION['user_id'])) > 1) {
        //	6/10/11
        $regs_string = "<FONT SIZE='-1'>Allocated " . get_text("Regions") . ":&nbsp;&nbsp;" . $al_names . "&nbsp;&nbsp;|&nbsp;&nbsp;Currently Viewing " . get_text("Regions") . ":&nbsp;&nbsp;" . $curr_names . "</FONT>";
        //	6/10/11
    } else {
        $regs_string = "";
    }
    ?>
<SCRIPT>
var obj_sugg;
 function createAutoComplete() {
Exemple #3
0
  	    <td class="TableData"><?php 
echo $result['name'];
?>
</td>
  	</tr>
	
	<tr>
  		<td nowrap class="TableContent" width="90">头像:</td>
  	  <td class="TableData">
	  <?php 
echo public_upload('pic', $result['pic']);
?>
</td>  	  	
  		<td nowrap class="TableContent" width="90">所属权限组:</td>
  	  <td class="TableData"><?php 
echo get_groupname($result['groupid']);
?>
</td>  	  	
  	</tr>
	
	<tr>
  		<td nowrap class="TableContent" width="90">所属部门:</td>
  	  <td class="TableData">
  	  	<?php 
echo get_realdepaname($result['departmentid']);
?>
  	  </td>  	  	
  		<td nowrap class="TableContent" width="90">所属岗位:</td>
  	  <td class="TableData"><?php 
echo get_postname($result['positionid']);
?>
Exemple #4
0
        } else {
            $post = "disable";
        }
        #echo $evtcfg.": ".$post;
        config($eventconfig['checkbox'][$i]['config'], $eventID, $post);
        $log_new[$evtcfg] = $post;
    }
    // End for
    log_add("eventadmin", "doConfig", serialize($log_new), serialize($log_old));
    header("Location: ?module=eventadmin&action=config&action=config&saved=OK");
} elseif (($action == "groupRights" || $action == "changeGroupRights") && !empty($_GET['groupID'])) {
    if (acl_access("eventadmin", "", $eventID) != 'Admin') {
        die("Sorry, you have to be eventadmin to give eventrights");
    }
    $groupID = $_GET['groupID'];
    $content .= "<h2>" . _("Editing group rights for:") . " <strong>" . get_groupname($groupID) . "</strong></h2>\n<br />\n";
    $content .= "<a href=\"?module=eventadmin&amp;action=groupManagement\">" . lang("Back to groups", "eventadmin") . "</a>\n<br /><br />\n";
    $content .= "<table>";
    // List up eventaccess-rights
    for ($i = 0; $i < count($eventaccess); $i++) {
        $qFindAccess = db_query("SELECT * FROM " . $sql_prefix . "_ACLs WHERE eventID = {$eventID}\n\t\t\tAND groupID = '" . db_escape($groupID) . "' AND accessmodule = '" . $eventaccess[$i] . "'");
        $rFindAccess = db_fetch($qFindAccess);
        $access = $rFindAccess->access;
        if (!isset($access)) {
            $access = 'No';
        }
        $content .= "<tr><td>";
        $content .= $eventaccess[$i];
        $content .= "</td><td>";
        if ($action == "changeGroupRights" && $eventaccess[$i] == $_GET['accessmodule']) {
            $content .= "<form method=POST action=?module=eventadmin&amp;action=doChangeRights&amp;groupID={$groupID}&amp;accessmodule={$eventaccess[$i]}>";
Exemple #5
0
            $authorized_ids[] = $row['cat_id'];
        }
        $inserts = array();
        $to_autorize_ids = array_diff($private_uppercats, $authorized_ids);
        foreach ($to_autorize_ids as $to_autorize_id) {
            $inserts[] = array('group_id' => $page['group'], 'cat_id' => $to_autorize_id);
        }
        mass_inserts(GROUP_ACCESS_TABLE, array('group_id', 'cat_id'), $inserts);
        invalidate_user_cache();
    }
}
// +-----------------------------------------------------------------------+
// |                             template init                             |
// +-----------------------------------------------------------------------+
$template->set_filenames(array('group_perm' => 'group_perm.tpl', 'double_select' => 'double_select.tpl'));
$template->assign(array('TITLE' => l10n('Manage permissions for group "%s"', get_groupname($page['group'])), 'L_CAT_OPTIONS_TRUE' => l10n('Authorized'), 'L_CAT_OPTIONS_FALSE' => l10n('Forbidden'), 'F_ACTION' => get_root_url() . 'admin.php?page=group_perm&amp;group_id=' . $page['group']));
// only private categories are listed
$query_true = '
SELECT id,name,uppercats,global_rank
  FROM ' . CATEGORIES_TABLE . ' INNER JOIN ' . GROUP_ACCESS_TABLE . ' ON cat_id = id
  WHERE status = \'private\'
    AND group_id = ' . $page['group'] . '
;';
display_select_cat_wrapper($query_true, array(), 'category_option_true');
$result = pwg_query($query_true);
$authorized_ids = array();
while ($row = pwg_db_fetch_assoc($result)) {
    $authorized_ids[] = $row['id'];
}
$query_false = '
SELECT id,name,uppercats,global_rank
Exemple #6
0
 if ($act == "view") {
     //查看别人的资料  http://51fabu.bj-soft.cn/mobile/profile.php?act=view&fromuid=1&touid=1
     $fuid = htmlspecialchars($_GET["fromuid"]);
     //来自谁
     $tuid = htmlspecialchars($_GET["touid"]);
     //要查看谁的资料
     $sql = "select regdate from disc_common_member where uid='{$tuid}'";
     $res0 = $db->Execute($sql);
     $sql = "select uid, gender,constellation, resideprovince, residecity, residedist,height,interest,birthyear,birthmonth,birthday from disc_common_member_profile where uid='{$tuid}'";
     $res = $db->Execute($sql);
     if ($res->fields['uid']) {
         $sql2 = "select * from disc_common_member where uid='{$tuid}'";
         $res2 = $db->Execute($sql2);
         $groupid = $res2->fields["groupid"];
         //用户组
         $groupname = get_groupname($groupid);
         //组名称
         $username = $res2->fields["username"];
         //昵称
         $credits = $res2->fields["credits"];
         //总计发放
         $birthyear = $res2->fields["birthyear"];
         $birthmonth = $res2->fields["birthmonth"];
         $birthday = $res2->fields["birthday"];
         $uid = $res->fields['uid'];
         $regdate = $res0->fields["regdate"];
         $server = $_SERVER["SERVER_NAME"];
         if ($regdate == "" || $regdate == null) {
             $avatar_url = "http://{$server}/uc_server/images/noavatar_middle.gif";
         } else {
             $uid2 = $uid;
function get_user_group_butts_readonly($user_id)
{
    //	6/10/11
    $query2 = "SELECT * FROM `{$GLOBALS['mysql_prefix']}allocates` WHERE `type`= 4 AND `resource_id` = '{$user_id}'";
    //	6/10/11
    $result2 = mysql_query($query2) or do_error($query2, 'mysql query failed', mysql_error(), basename(__FILE__), __LINE__);
    $al_buttons = "<DIV ID='groups_sh' style='width: 100%; align: left; display: none;'>";
    while ($row2 = stripslashes_deep(mysql_fetch_assoc($result2))) {
        //	6/10/11
        $al_buttons .= "<DIV style='float: left;'><INPUT TYPE='checkbox' CHECKED name='frm_group[]' OnClick='javascript:return ReadOnlyCheckBox()' onkeydown='javascript:return ReadOnlyCheckBox()' VALUE='{$row2['group']}'></INPUT>" . get_groupname($row2['group']) . "&nbsp;&nbsp;</DIV>";
    }
    $al_buttons .= "</DIV>";
    return $al_buttons;
}
Exemple #8
0
    }
    if ($department = getGP('department', 'P', 'int')) {
        $wheresql .= " AND a.departmentid = {$department}";
    }
    if ($usergroup = getGP('usergroup', 'P', 'int')) {
        $wheresql .= " AND a.groupid = {$usergroup}";
    }
    $sql = "SELECT * FROM " . DB_TABLEPRE . "user a," . DB_TABLEPRE . "user_view b WHERE a.id=b.uid {$wheresql} ORDER BY a.id ASC";
    $result = $db->query($sql);
    while ($row = $db->fetch_array($result)) {
        if ($row['ischeck'] == '1') {
            $ischeck = '正常';
        } else {
            $ischeck = '禁用';
        }
        $archive = array("" . $row[username] . "", "" . get_groupname($row['groupid']) . "", "" . $row[name] . "", "" . get_postname($row['positionid']) . "", "" . $ischeck . "", "" . $row[loginip] . "", "" . get_realdepaname($row['departmentid']) . "");
        $content[] = $archive;
    }
    $excel = new ExcelWriter($outputFileName);
    if ($excel == false) {
        echo $excel->error;
    }
    foreach ($content as $v) {
        $excel->writeLine($v);
    }
    $excel->sendfile($outputFileName);
} elseif ($do == 'add') {
    if ($_POST['view'] != '') {
        $id = getGP('id', 'P', 'int');
        if ($id != '') {
            $username = getGP('username', 'P');
Exemple #9
0
 class="checkbox" /></td>
<td class="checkbox"><input name="numbers[<?php 
    echo $row['id'];
    ?>
]" type="text" style="width:30px;" value="<?php 
    echo $row['numbers'];
    ?>
" /></td>

<td class="title">
<ul><li class="name"><?php 
    echo $row['username'];
    ?>
</li>
<li class="no J-bizNo">	<?php 
    echo get_groupname($row['groupid']);
    ?>
</li></ul>
</td>
<td class="name"><?php 
    echo $row['name'];
    ?>
</td>
<td class="status">
<span class="amount-pay amount-pay-out"><?php 
    if ($row['ischeck'] == '1') {
        echo '正常';
    } else {
        echo '<font color=red>禁用</font>';
    }
    ?>
Exemple #10
0
</table>

<form name="save" method="post" action="#">
	<table class="TableBlock" width="90%" align="center">
  <tr>
    <td nowrap class="TableHeader" colspan="6"><b>&nbsp;基本信息</b></td>
  </tr>
   <tr>
    <td nowrap align="left" width="120" class="TableContent">OA用户名:</td>
    <td nowrap align="left" class="TableData" width="180"><?php 
echo get_realusername($blog['userid'], 'username');
?>
</td>
    <td nowrap align="left" width="120" class="TableContent">权限组:</td>
    <td class="TableData"  colspan="2"><?php 
echo get_groupname(get_realusername($blog['userid'], 'groupid'));
?>
</td>
    <td class="TableData" align="center" rowspan="6" colspan="1">
<div class="avatar"><img src="<?php 
echo get_human_db($blog['id'], "toa_1_56");
?>
" width=130></div>
    </td>           
  </tr>
  <tr>
  	<td nowrap align="left" width="120" class="TableContent">编号:</td>
    <td nowrap align="left" class="TableData" width="180"><?php 
echo $blog['number'];
?>
</td>