Example #1
0
 public function actionUpdate()
 {
     CacheUtil::update();
     OrgUtil::update();
     if (LOCAL) {
         Ibos::app()->assetManager->republicAll();
     }
     ModuleUtil::updateConfig();
     EnvUtil::iExit("缓存更新完成");
 }
Example #2
0
 public function syncUser()
 {
     $oplist = array("confirm", "sync");
     $op = EnvUtil::getRequest("op");
     if (!in_array($op, $oplist)) {
         $op = "confirm";
     }
     $syncUsers = User::model()->fetchAllByUids($this->getUid());
     $flag = $this->getSyncFlag();
     if ($op == "confirm") {
         if ($flag != 1) {
             $bindingUser = $this->getBindingUser($this->getUid());
             if (!empty($bindingUser)) {
                 $userNames = explode(",", User::model()->fetchRealnamesByUids($bindingUser));
                 $uids = $bindingUser;
             } else {
                 $exit = "<script>parent.Ui.tip('无需同步','success');parent.Ui.closeDialog();</script>";
                 EnvUtil::iExit($exit);
             }
         } else {
             $userNames = ConvertUtil::getSubByKey($syncUsers, "realname");
             $uids = $this->getUid();
         }
         $properties = array("usernames" => $userNames, "uid" => implode(",", $uids), "flag" => $flag);
         Ibos::app()->getController()->renderPartial("application.modules.organization.views.im.qqsync", $properties);
     } elseif ($op == "sync") {
         $count = count($syncUsers);
         if ($flag == 1) {
             $res = $this->addUser($syncUsers);
         } else {
             $res = $this->setUserStatus($syncUsers, $flag);
         }
         if (1 <= $count && $count == $res) {
             $exit = "\t\t\t<script>parent.Ui.tip('同步完成','success');parent.Ui.closeDialog();</script>";
         } else {
             $errors = $this->getError(self::ERROR_SYNC);
             $exit = implode(",", array_unique($errors));
         }
         EnvUtil::iExit($exit);
     }
 }
Example #3
0
 public function actionSyncUser()
 {
     $type = EnvUtil::getRequest("type");
     $uid = StringUtil::filterStr(EnvUtil::getRequest("uid"));
     $flag = intval(EnvUtil::getRequest("flag"));
     $pwd = EnvUtil::getRequest("pwd");
     if (MessageUtil::getIsImOpen($type)) {
         $im = Ibos::app()->setting->get("setting/im");
         $imCfg = $im[$type];
         $className = "ICIM" . ucfirst($type);
         $factory = new ICIMFactory();
         $properties = array("uid" => explode(",", $uid), "syncFlag" => $flag);
         if ($type == "rtx") {
             $properties["pwd"] = $pwd;
         }
         $adapter = $factory->createAdapter($className, $imCfg, $properties);
         return $adapter !== false ? $adapter->syncUser() : EnvUtil::iExit("初始化IM组件失败");
     } else {
         EnvUtil::iExit("未开启IM绑定");
     }
 }
Example #4
0
                @setcookie($k, "", time() - 86400, $cookiePath, $cookieDomain, $secure, false);
            }
            $account = Ibos::app()->setting->get("setting/account");
            $user = Ibos::app()->user;
            if ($account["allowshare"] != 1) {
                $user->setStateKeyPrefix(Ibos::app()->setting->get("sid"));
            }
            $user->login($identity);
            $log = array("terminal" => "bqqsso", "password" => "", "ip" => $ip, "user" => $curUser["username"], "loginType" => $identity::LOGIN_BY_USERNAME, "address" => "", "gps" => "");
            Log::write($log, "login", sprintf("module.user.%d", $uid));
            $rule = UserUtil::updateCreditByAction("daylogin", $uid);
            if (!$rule["updateCredit"]) {
                UserUtil::checkUserGroup($uid);
            }
            if ($returnurl == "index") {
                header("Location: ../../index.php", true);
            } else {
                $url = parse_url($returnurl);
                if (isset($url["scheme"])) {
                    header("Location:" . $returnurl, true);
                } else {
                    header("Location:../../" . $returnurl, true);
                }
            }
        }
    } else {
        EnvUtil::iExit($status["msg"]);
    }
} else {
    EnvUtil::iExit("该用户未绑定企业QQ");
}
 public function handleSystemConfigure($event)
 {
     $global = Ibos::app()->setting->toArray();
     $timeOffset = $global["setting"]["timeoffset"];
     $this->setTimezone($timeOffset);
     if (!Ibos::app()->user->isGuest) {
         define("FORMHASH", EnvUtil::formHash());
     } else {
         define("FORMHASH", "");
     }
     define("VERHASH", $global["setting"]["verhash"]);
     if ($global["setting"]["appclosed"]) {
         $route = Ibos::app()->getUrlManager()->parseUrl(Ibos::app()->getRequest());
         if (!empty($route)) {
             list($module) = explode("/", $route);
         } else {
             $module = "";
         }
         if (!Ibos::app()->user->isGuest && Ibos::app()->user->isadministrator) {
         } elseif (in_array($module, array("dashboard", "user"))) {
         } else {
             if (defined("IN_SWFHASH") && IN_SWFHASH) {
             } else {
                 EnvUtil::iExit(Ibos::lang("System closed", "message"));
             }
         }
     }
 }
Example #6
0
 public static function getFlowSearch($flowId, $searchType, $uid, $toId = "")
 {
     $condition = array();
     $flowIds = WfQueryUtil::getMyFlowIDs($uid);
     $myRuns = FlowRun::model()->fetchAllMyRunID($uid, $flowId);
     if ($searchType == "all" && Ibos::app()->user->isadministrator != 1) {
         $condition[] = sprintf("(fr.runid IN (%s) OR FIND_IN_SET('%s',ft.flowid))", implode(",", $myRuns), implode(",", $flowIds));
     } elseif ($searchType == "1") {
         $beginUser = $uid;
     } elseif ($searchType == "2") {
         $condition[] = sprintf("fr.runid IN (%s)", implode(",", $myRuns));
     } else {
         if ($searchType == "3" && Ibos::app()->user->isadministrator != 1) {
             $condition[] = sprintf("(FIND_IN_SET('%s',ft.flowid)", implode(",", $flowIds));
         } elseif (Ibos::app()->user->isadministrator != 1) {
             EnvUtil::iExit(Ibos::lang("Parameters error", "error"));
         }
     }
     if (!empty($toId) && $searchType !== "1") {
         $beginUser = $toId;
     }
     if (isset($beginUser)) {
         $condition[] = "fr.beginuser = {$beginUser}";
     }
     return $condition;
 }
Example #7
0
 protected function nextAccessCheck($topflag, $runId, $processId)
 {
     $per = WfCommonUtil::getRunPermission($runId, $this->uid, $processId);
     if ($topflag != 2) {
         if (!StringUtil::findIn($per, 1) && !StringUtil::findIn($per, 2) && !StringUtil::findIn($per, 3)) {
             EnvUtil::iExit("必须是系统管理员,主办人,管理或监控人才能进行操作");
         }
     } elseif (!StringUtil::findIn($per, 4)) {
         EnvUtil::iExit("您不是经办人,没有权限进行操作。");
     }
 }
Example #8
0
 public function syncUser()
 {
     $syncFlag = $this->getSyncFlag();
     try {
         if (in_array($syncFlag, array(1, 0))) {
             $syncUsers = User::model()->fetchAllByUids($this->getUid());
             $obj = $this->getObj();
             $userObj = $obj->UserManager();
             foreach ($syncUsers as $user) {
                 $userName = ConvertUtil::iIconv($user["username"], CHARSET, "gbk");
                 if ($syncFlag == 1) {
                     $realName = ConvertUtil::iIconv($user["realname"], CHARSET, "gbk");
                     $userObj->AddUser($userName, 0);
                     $userObj->SetUserPwd($userName, $this->getPwd());
                     $userObj->SetUserBasicInfo($userName, $realName, -1, $user["mobile"], $user["email"], $user["telephone"], 0);
                 } elseif ($userObj->IsUserExist($userName)) {
                     $userObj->DeleteUser($userName);
                 }
             }
         }
         $exit = "\t\t\t<script>parent.Ui.tip('同步完成','success');parent.Ui.closeDialog();</script>";
         EnvUtil::iExit($exit);
     } catch (Exception $exc) {
         $exit = "\t\t\t<script>parent.Ui.tip('同步出现问题,无法完成。请联系系统管理员解决','danger');parent.Ui.closeDialog();</script>\t\t\t\t";
         EnvUtil::iExit($exit);
     }
 }
Example #9
0
 private function handleUserNames($rows, &$userNamestr, $step, $var)
 {
     foreach ($rows as $row) {
         $userName = User::model()->fetchRealnameByUid($row["uid"]);
         if ($row["opflag"]) {
             $userName .= "[{$var["lang"]["Host user"]}]";
         }
         $isCurStep = $step == $var["processid"];
         $isMe = $row["uid"] == Ibos::app()->user->uid;
         $userNamestr .= $this->handleFlag(intval($row["flag"]), $userName, $var["lang"]);
         if ($isCurStep && $row["flag"] != 4 && !$isMe) {
             $this->_notFinished .= $userName . ",";
         }
         $isDone = $row["flag"] == 3 || $row["flag"] == 4;
         $notInManageMode = $var["op"] != "manage";
         if ($isCurStep && $isDone && $isMe && $notInManageMode) {
             EnvUtil::iExit($var["lang"]["Already trans"]);
         }
         $userNamestr = StringUtil::filterStr($userNamestr);
     }
 }