Пример #1
0
// FORUM Maintenance Section
if ($type == "forum") {
    if ($mode == 'add') {
        if ($confirm == 1 && SEC_checkToken()) {
            $category = isset($_POST['category']) ? COM_applyFilter($_POST['category'], true) : 0;
            $dscp = isset($_POST['dscp']) ? gf_preparefordb($_POST['dscp'], 'text') : '';
            $is_hidden = isset($_POST['is_hidden']) ? COM_applyFilter($_POST['is_hidden'], true) : 0;
            $is_readonly = isset($_POST['is_readonly']) ? COM_applyFilter($_POST['is_readonly'], true) : 0;
            $name = isset($_POST['name']) ? gf_preparefordb($_POST['name'], 'text') : '';
            $no_newposts = isset($_POST['no_newposts']) ? COM_applyFilter($_POST['no_newposts'], true) : 0;
            $order = isset($_POST['order']) ? COM_applyFilter($_POST['order'], true) : 0;
            $privgroup = isset($_POST['privgroup']) ? COM_applyFilter($_POST['privgroup'], true) : 0;
            if ($privgroup == 0) {
                $privgroup = 2;
            }
            if (forum_addForum($name, $category, $dscp, $order, $privgroup, $is_readonly, $is_hidden, $no_newposts) > 0) {
                $display = COM_refresh($_CONF['site_admin_url'] . '/plugins/forum/boards.php?msg=4');
            } else {
                $display = COM_refresh($_CONF['site_admin_url'] . '/plugins/forum/boards.php?msg=5');
            }
            COM_output($display);
            exit;
        } else {
            $grouplist = '';
            $groupname = '';
            $result = DB_query("SELECT DISTINCT grp_id, grp_name FROM {$_TABLES['groups']}");
            $nrows = DB_numRows($result);
            if ($nrows > 0) {
                for ($i = 1; $i <= $nrows; $i++) {
                    $G = DB_fetchArray($result);
                    if ($G['grp_id'] == 2) {
Пример #2
0
 }
 if ($_CLEAN['document'] == 'Y') {
     $retchk = fm_createCategory($_PRJCONF['nexfile_parent'], $_CLEAN['name'], $_CLEAN['description'], true);
     $catid = $retchk[0];
     $retmsg = $retchk[1];
     DB_query("UPDATE {$_TABLES['prj_projects']} SET cid='{$catid}' WHERE pid='{$lastid}'");
     $logentry = "Project ID-{$lastid}, nexfile Folder created ID: {$catid}. Msg: {$retmsg}";
     prg_updateAuditLog($logentry);
     $uid = $_USER['uid'];
     DB_query("INSERT INTO {$_TABLES['nxfile_access']} (catid,uid,view, upload, upload_direct, upload_ver, approval, admin) VALUES ('{$catid}','{$uid}','1','1','1','1','1','1')");
     if ($_POST['private'] == 'N') {
         DB_query("INSERT INTO {$_TABLES['nxfile_access']} (catid,grp_id, view, upload, upload_direct, upload_ver, approval, admin) VALUES ('{$catid}','2','1','0','0','0','0','0')");
     }
 }
 if ($_CLEAN['forum'] == 'Y') {
     $forumid = forum_addForum($_CLEAN['name'], $_PRJCONF['forum_parent'], $_CLEAN['description'], 0);
     DB_query("UPDATE {$_TABLES['prj_projects']} SET fid={$forumid} WHERE pid={$lastid}");
     $logentry = "Project ID-{$lastid}, FORUM created ID: {$forumid}";
     prg_updateAuditLog($logentry);
 }
 /*********************************************/
 //create new project default permissions here
 //whoever created it, gets full perms.
 /*********************************************/
 $sql = "insert into {$_TABLES['prj_projPerms']} (pid, taskID, uid, gid, viewRead, writeChange, fullAccess, seeDetails) values ";
 $sql .= "(";
 $sql .= "'{$lastid}',";
 $sql .= "'0',";
 $sql .= "'{$_USER['uid']}',";
 $sql .= "'0',";
 $sql .= "'1',";