public function delete_by_orgid($orgids)
 {
     if (!$orgids) {
         return;
     }
     $orgids = (array) $orgids;
     $uids = self::fetch_uids_by_orgid($orgids);
     if ($return = DB::delete($this->_table, "orgid IN (" . dimplode($orgids) . ")")) {
         if ($uids) {
             wx_updateUser($uids);
         }
         return $return;
     } else {
         return false;
     }
 }
예제 #2
0
    //如果输入微信号,检查微信号不能重复
    $weixinid = trim($_GET['weixinid']);
    if ($weixinid) {
        if (!preg_match("/^[A-Za-z][\\w|-]+\$/i", $weixinid)) {
            showmessage('微信号不合法');
        }
        if ($weixinid != $member['weixinid'] && C::t('user')->fetch_by_weixinid($weixinid)) {
            showmessage('该微信号已经被注册');
        }
        $setarr['weixinid'] = $weixinid;
    } else {
        $setarr['weixinid'] = '';
    }
    if ($setarr) {
        if (C::t('user')->update($_G['uid'], $setarr)) {
            wx_updateUser($_G['uid']);
        }
    }
    showmessage('do_success', dreferer());
} elseif ($_GET['sendmail']) {
    $user = C::t('user')->fetch($_G['uid']);
    $idstring = random(6);
    $authstr = $_G['setting']['regverify'] == 1 ? "{$_G['timestamp']}\t2\t{$idstring}" : '';
    C::t('user')->update($_G['uid'], array('authstr' => $authstr));
    $verifyurl = "{$_G[siteurl]}user.php?mod=activate&uid={$_G[uid]}&id={$idstring}";
    $email_verify_message = lang('email', 'email_verify_message', array('username' => $_G['member']['username'], 'sitename' => $_G['setting']['sitename'], 'siteurl' => $_G['siteurl'], 'url' => $verifyurl));
    if (!sendmail("{$user['username']} <{$user['email']}>", lang('email', 'email_verify_subject'), $email_verify_message)) {
        runlog('sendmail', "{$user['email']} sendmail failed.");
        showmessage('邮件发送失败!请检查您的登录邮箱是否正确,或者更换登录邮箱', 'user.php?mod=password');
    } else {
        showmessage('邮件已发送,可能需要等几分钟才能收到邮件', 'user.php?mod=password');
예제 #3
0
             showmessage('profile_password_tooshort', '', array('pwlength' => $_G['setting']['pwlength']));
         }
     }
     if ($_GET['password'] !== $_GET['password2']) {
         showmessage('profile_passwd_notmatch');
     }
 }
 $password = $_GET['password'];
 if ($password) {
     $salt = substr(uniqid(rand()), -6);
     $setarr = array('salt' => $salt, 'password' => md5(md5($password) . $salt), 'username' => $username, 'nickname' => $nickname, 'phone' => $phone, 'weixinid' => $weixinid, 'secques' => '', 'email' => $email, 'status' => intval($_GET['status']));
 } else {
     $setarr = array('username' => $username, 'email' => $email, 'nickname' => $nickname, 'phone' => $phone, 'weixinid' => $weixinid, 'status' => intval($_GET['status']));
 }
 C::t('user')->update($uid, $setarr);
 wx_updateUser($uid);
 //处理管理员
 if ($user['adminid'] != intval($_GET['adminid'])) {
     C::t('user')->setAdministror($uid, intval($_GET['adminid']));
 }
 //处理额外空间
 $addsize = intval($_GET['addsize']);
 if (C::t('user_field')->fetch($uid)) {
     C::t('user_field')->update($uid, array('addsize' => $addsize, 'perm' => 0));
 } else {
     C::t('user_field')->insert(array('uid' => $uid, 'addsize' => $addsize, 'perm' => 0, 'iconview' => $_G['setting']['desktop_default']['iconview'] ? $_G['setting']['desktop_default']['iconview'] : 2, 'taskbar' => $_G['setting']['desktop_default']['taskbar'] ? $_G['setting']['desktop_default']['taskbar'] : 'bottom', 'iconposition' => intval($_G['setting']['desktop_default']['iconposition']), 'direction' => intval($_G['setting']['desktop_default']['direction'])));
 }
 //处理用户部门和职位
 $orgids = array();
 foreach ($_GET['orgids'] as $key => $value) {
     $orgids[$value] = intval($_GET['jobids'][$key]);