diff --git a/admin/appmanagement/template/main.htm b/admin/appmanagement/template/main.htm index 6110b3b..d7bce3c 100644 --- a/admin/appmanagement/template/main.htm +++ b/admin/appmanagement/template/main.htm @@ -6,6 +6,9 @@ border: none; background: none; } +.row{ + padding: 1rem; +} diff --git a/admin/appmarket/index.php b/admin/appmarket/index.php index c9e016c..2fb818c 100644 --- a/admin/appmarket/index.php +++ b/admin/appmarket/index.php @@ -41,8 +41,11 @@ $order = ' ORDER BY disp'; $start = ($page - 1) * $perpage; $apps = array(); $string = " 1 "; +$param=array('app_market'); if ($keyword) { - $string .= " and appname like '%$keyword%' or vendor like '%$keyword%'"; + $string .= " and appname like %s or vendor like %s"; + $param[]='%'.$keyword.'%'; + $param[]='%'.$keyword.'%'; } if ($tagid) { $appids = C::t('app_relative') -> fetch_appids_by_tagid($tagid); @@ -52,11 +55,10 @@ if ($group) { $sql = " and `group` = '{$group}'"; $string .= " and `group` = '{$group}'"; } -if ($count = DB::result_first("SELECT COUNT(*) FROM " . DB::table('app_market') . " WHERE ".$string)) { - $apps = DB::fetch_all("SELECT * FROM " . DB::table('app_market') . " WHERE ".$string." $order limit $start,$perpage"); +if ($count = DB::result_first("SELECT COUNT(*) FROM %t WHERE ".$string,$param)) { + $apps = DB::fetch_all("SELECT * FROM %t WHERE ".$string." $order limit $start,$perpage",$param); $multi = multi($count, $perpage, $page, $theurl, 'pull-right'); } - $list = array(); $grouptitle = array('0' => lang('all'), '-1' => lang('visitors_visible'), '1' => lang('members_available'), '2' => lang('section_administrators_available'), '3' => lang('system_administrators_available')); foreach ($apps as $value) { diff --git a/admin/orguser/ajax.php b/admin/orguser/ajax.php new file mode 100644 index 0000000..9a39bba --- /dev/null +++ b/admin/orguser/ajax.php @@ -0,0 +1,519 @@ +'.strtoupper(new_strsubstr($v['text'],1,'')).''.$v['text']; + + }else{ + $v['icon'] = false; + $v['text']= avatar_block($uid,array(),'iconFirstWord').$v['text']; + } + $data[] = $v; + } +} +$do = trim($_GET['do']); +$orgid = intval($_GET['orgid']); +if ($do == 'upload') {//上传图片文件 + include libfile('class/uploadhandler'); + $options = array('accept_file_types' => '/\.(gif|jpe?g|png)$/i', + 'upload_dir' => $_G['setting']['attachdir'] . 'cache/', + 'upload_url' => $_G['setting']['attachurl'] . 'cache/', + 'thumbnail' => array('max-width' => 40, 'max-height' => 40)); + $upload_handler = new uploadhandler($options); + exit(); +} /*elseif ($do == 'getdefaultpic') {//获取群组默认图片,上传图片保存 + $imgs = C::t('resources_grouppic')->fetch_user_pic(); + if (isset($_GET['aid'])) { + $aid = intval($_GET['aid']); + if ($_G['adminid'] == 1) $dafault = 1; + else $default = 0; + if (C::t('resources_grouppic')->insert_data($aid, $default)) { + showTips(array('success' => true), 'json'); + } else { + showTips(array('error' => true), 'json'); + } + } +}*/elseif($do == 'getchildren') { + + $id = intval($_GET['id']); + $list = array(); + $limit = 0; + $html = ''; + + //判断用户有没有操作权限 + $ismoderator = C::t('organization_admin') -> ismoderator_by_uid_orgid($id, $_G['uid']); + if ($ismoderator) { + $disable = ''; + $type = 'user'; + } else { + $disable = '"disabled":true,'; + $type = "disabled"; + } + if ($id) { + $icon = 'dzz/system/images/department.png'; + } else { + $icon = 'dzz/system/images/organization.png'; + } + $data = array(); + if ($_GET['id'] == '#') { + if($_G['adminid']!=1) $topids=C::t('organization_admin')->fetch_toporgids_by_uid($_G['uid']); + foreach (C::t('organization')->fetch_all_by_forgid($id,0,0) as $value) { + if($value['type']==1) continue;//过滤群 + if($_G['adminid']!=1 && !in_array($value['orgid'],$topids)) continue; + if (C::t('organization_admin') -> ismoderator_by_uid_orgid($value['orgid'], $_G['uid'])) { + $orgdisable = false; + $orgtype = 'organization'; + } else { + $orgdisable = true; + $orgtype = 'disabled'; + } + $arr=array('id' => $value['orgid'], 'text' => $value['orgname'], 'icon' => $icon, 'state' => array('disabled' => $orgdisable), "type" => $orgtype, 'children' => true); + if(intval($value['aid'])==0){ + $arr['text'] = avatar_group($value['orgid'],array($value['orgid']=>array('aid'=>$value['aid'],'orgname'=>$value['orgname']))).$value['orgname']; + $arr['icon'] = false; + }else{ + $arr['text'] = $value['orgname']; + $arr['icon']='index.php?mod=io&op=thumbnail&width=24&height=24&path=' . dzzencode('attach::' . $value['aid']); + } + $data[]=$arr; + + } + + $data[] = array('id' => 'other', 'text' => lang('no_institution_users'), 'state' => array('disabled' => $disable), "type" => 'group', 'children' => true); + } else { + //获取用户列表 + + if (!$id) { + + if ($ismoderator) { + $uids = array(); + $datas = array(); + foreach (C::t('organization_user')->fetch_user_not_in_orgid($limit) as $value) { + if(!$value['uid']) continue; + $uids[] = $value['uid']; + $datas[] = array('id' => 'uid_' . $value['uid'], 'text' => $value['username'] . '' . $value['email'] . '', 'icon' => 'dzz/system/images/user.png', 'state' => array('disabled' => $disable), "type" => $type, 'li_attr' => array('uid' => $value['uid'])); + } + getuserIcon($uids,$datas,$data); + } + + } else { + foreach (C::t('organization')->fetch_all_by_forgid($id) as $value) { + if (C::t('organization_admin') -> ismoderator_by_uid_orgid($value['orgid'], $_G['uid'])) { + $orgdisable = ''; + $orgtype = 'organization'; + } else { + $orgdisable = '"disabled":true,'; + $orgtype = 'disabled'; + } + $arr=array('id' => $value['orgid'], 'text' => $value['orgname'], 'icon' => $icon, 'state' => array('disabled' => $orgdisable), "type" => $orgtype, 'children' => true); + if(intval($value['aid'])==0){ + $arr['text'] = avatar_group($value['orgid'],array($value['orgid']=>array('aid'=>$value['aid'],'orgname'=>$value['orgname']))).$value['orgname']; + $arr['icon'] = false; + }else{ + $arr['text'] = $value['orgname']; + $arr['icon']='index.php?mod=io&op=thumbnail&width=24&height=24&path=' . dzzencode('attach::' . $value['aid']); + } + $data[]=$arr; + } + if ($ismoderator) { + $uids = array(); + $datas = array(); + foreach (C::t('organization_user')->fetch_user_by_orgid($id,$limit) as $value) { + if(!$value['uid']) continue; + $uids[] = $value['uid']; + $datas[] = array('id' => 'orgid_' . $value['orgid'] . '_uid_' . $value['uid'], 'text' => $value['username'] . '' . $value['email'] . '', 'icon' => 'dzz/system/images/user.png', 'state' => array('disabled' => $disable), "type" => $type, 'li_attr' => array('uid' => $value['uid'])); + } + getuserIcon($uids,$datas,$data); + } + } + + } + + exit(json_encode($data)); +} elseif ($do == 'search') {//jstree搜索接口 + $str = trim($_GET['str']); + $str = '%' . $str . '%'; + $sql = "username LIKE %s"; + //搜索用户 + $data = array('other'); + $uids = array(); + foreach (DB::fetch_all("select * from %t where $sql ",array('user',$str)) as $value) { + $uids[] = $value['uid']; + $data['uid_' . $value['uid']] = 'uid_' . $value['uid']; + } + $orgids = array(); + foreach ($orgusers=C::t('organization_user')->fetch_all_by_uid($uids) as $value) { + $data['uid_' . $value['uid']] = 'orgid_' . $value['orgid'] . '_uid_' . $value['uid']; + $orgids[] = $value['orgid']; + } + + foreach ($orgids as $orgid) { + $uporgids = C::t('organization')->fetch_parent_by_orgid($orgid); + foreach ($uporgids as $value) { + $data[$value] = $value; + } + } + $temp = array(); + foreach ($data as $value) { + $temp[] = $value; + } + exit(json_encode($temp)); + +} elseif ($do == 'getjobs') { + $orgid = intval($_GET['orgid']); + $jobs = C::t('organization_job') -> fetch_all_by_orgid($orgid); + $html = '
您收到这封邮件,是由于 $sitename 的管理员添加成员时使用了这个邮箱地址。如果您不知道 $sitename 请忽略这封邮件。您不需要退订或进行其他进一步的操作。
+登录帐号和密码
+登录帐号:$_GET[email]
+登录密码:$_GET[password]
+感谢您的访问,祝您使用愉快!
+EOT; + + if (!sendmail("$_GET[email] <$_GET[email]>", '用户帐号和密码', $email_password_message)) { + runlog('sendmail', "$_GET[email] 发送失败"); + } + } + + showmessage('add_user_success', MOD_URL.'#user_' . $uid, array('uid' => $uid, 'orgids' => $orgids)); + + } else { + $orgid = intval($_GET['orgid']); + if (!C::t('organization_admin') -> ismoderator_by_uid_orgid($orgid, $_G['uid'])) { + exit(lang('orguser_edituser_add_user')); + } + if ($org = C::t('organization') -> fetch($orgid)) { + $org['jobs'] = C::t('organization_job') -> fetch_all_by_orgid($org['orgid']); + $orgpath = getPathByOrgid($org['orgid']); + $org['depart'] = implode('-', ($orgpath)); + } + + include template('adduser'); + } + +} elseif ($do == 'edit') { + if (submitcheck('accountedit')) { + + //判断是否对此用户有管理权限 + $uperm = false; + if ($_G['adminid'] != 1) { + if ($orgids_uid = C::t('orginization_user') -> fetch_orgids_by_uid($uid)) { + foreach ($orgids_uid as $orgid) { + if (C::t('organization_admin') -> ismoderator_by_uid_orgid($orgid, $_G['uid'])) { + $uperm = true; + break; + } + } + if (!$uperm) + showmessage('privilege'); + } else { + showmessage('privilege'); + } + } + + $orgids = array(); + foreach ($_GET['orgids'] as $key => $orgid) { + if ($orgid) + $orgids[$orgid] = intval($_GET['jobids'][$key]); + } + + $user = C::t('user') -> fetch_by_uid($uid); + if ($user['groupid'] < $_G['groupid'] || (C::t('user') -> checkfounder($user) && !C::t('user') -> checkfounder($_G['member']))) { + //处理用户部门和职位 + C::t('organization_user') -> replace_orgid_by_uid($uid, $orgids); + + //处理上司职位; + C::t('organization_upjob') -> insert_by_uid($uid, intval($_GET['upjobid'])); + + showmessage('edit_user_success', MOD_URL.'#user_' . $uid, array()); + } + + + //用户名验证 + $username = trim($_GET['username']); + + $usernamelen = dstrlen($_GET['username']); + if ($usernamelen < 3) { + showmessage('profile_username_tooshort'); + } elseif ($usernamelen > 30) { + showmessage('profile_username_toolong'); + } elseif (!check_username(addslashes(trim(stripslashes($username))))) { + showmessage('profile_username_illegal'); + } + + //如果输入用户名,检查用户名不能重复 + if ($username != $user['username']) { + if (C::t('user') -> fetch_by_username($username)) { + showmessage('user_registered_retry'); + } + if ($_G['setting']['censoruser'] && @preg_match($censorexp, $username)) { + showmessage('profile_username_protect'); + } + } + + + //如果输入手机号码,检查手机号码不能重复 + $phone = trim($_GET['phone']); + if ($phone) { + if (!preg_match("/^\d+$/", $phone)) { + showmessage('user_phone_illegal'); + } + if ($phone != $user['phone'] && C::t('user') -> fetch_by_phone($phone)) { + showmessage('user_phone_registered'); + } + } + //如果输入微信号,检查微信号不能重复 + $weixinid = trim($_GET['weixinid']); + if ($weixinid) { + if (!preg_match("/^[a-zA-Z\d_]{5,}$/i", $weixinid)) { + showmessage(lang('weixin_illegal')); + } + if ($weixinid != $user['weixinid'] && C::t('user') -> fetch_by_weixinid($weixinid)) { + showmessage('weixin_registered'); + } + } + + //邮箱验证部分 + $email = strtolower(trim($_GET['email'])); + if (!isemail($email)) { + showmessage('profile_email_illegal', '', array(), array('handle' => false)); + } elseif (!check_emailaccess($email)) { + showmessage('profile_email_domain_illegal', '', array(), array('handle' => false)); + } + if ($email != strtolower($user['email'])) { + //邮箱不能重复 + if (C::t('user') -> fetch_by_email($email)) { + showmessage('email_registered_retry'); + } + } + + //密码验证部分 + if ($_GET['password']) { + if ($_G['setting']['pwlength']) { + if (strlen($_GET['password']) < $_G['setting']['pwlength']) { + 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, 'phone' => $phone, 'weixinid' => $weixinid, 'secques' => '', 'email' => $email, 'status' => intval($_GET['status'])); + + } else { + $setarr = array('username' => $username, 'email' => $email, 'phone' => $phone, 'weixinid' => $weixinid, 'status' => intval($_GET['status'])); + } + C::t('user') -> update($uid, $setarr); + + //处理管理员 + C::t('user') -> setAdministror($uid, intval($_GET['groupid'])); + //处理额外空间和用户空间 + //$addsize = intval($_GET['addsize']); + $userspace = intval($_GET['userspace']); + if (C::t('user_field') -> fetch($uid)) { + C::t('user_field') -> update($uid, array('userspace'=>$userspace,'perm' => 0)); + } else { + C::t('user_field') -> insert(array('uid' => $uid,'userspace'=>$userspace, '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']), )); + } + //处理用户部门和职位 + + if ($orgids) + C::t('organization_user') -> replace_orgid_by_uid($uid, $orgids); + //处理上司职位; + + C::t('organization_upjob') -> insert_by_uid($uid, intval($_GET['upjobid'])); + Hook::listen('syntoline_user',$uid);//注册绑定到钉钉部门表 + showmessage('edit_user_success', MOD_URL.'#user_' . $uid, array()); + } else { + require_once libfile('function/organization'); + + $user = C::t('user') -> fetch_by_uid($uid); + $userfield = C::t('user_field') -> fetch($uid); + + //$user['status']=$user['status']>0?0:1; + $departs = array(); + $data_depart = array(); + //$departs=getDepartmentByUid($uid); + $orgids = C::t('organization_user') -> fetch_orgids_by_uid($uid); + //判断是否对此用户有管理权限 + $uperm = false; + if ($_G['adminid'] != 1) { + foreach ($orgids as $orgid) { + if (C::t('organization_admin') -> ismoderator_by_uid_orgid($orgid, $_G['uid'])) { + $uperm = true; + break; + } + } + if (!$uperm) + exit(lang('orguser_edituser_add_user1')); + } + //获取系统可分配空间大小 + $allowallotspace = C::t('organization')->get_system_allowallot_space(); + //如果该用户之前有分配空间,当前用户可分配空间=系统可分配空间+该用户之前分配空间(若无,则加上当前用户已使用空间) + if($userfield['userspace'] > 0){ + $currentuserAllotspace = $allowallotspace + $userfield['userspace']*1024*1024; + }else{ + $currentuserAllotspace = $allowallotspace + $userfield['usesize']; + } + $departs = C::t('organization') -> fetch_all($orgids); + foreach ($departs as $key => $value) { + $orgpath = getPathByOrgid($value['orgid']); + $value['depart'] = implode('-', ($orgpath)); + $value['ismoderator'] = C::t('organization_admin') -> ismoderator_by_uid_orgid($value['orgid'], $_G['uid']); + $value['jobs'] = C::t('organization_job') -> fetch_all_by_orgid($value['orgid']); + $value['user'] = C::t('organization_user') -> fetch_by_uid_orgid($uid, $value['orgid']); + $value['jobid'] = $value['user']['jobid']; + $value['jobname'] = $value['jobs'][$value['jobid']] ? $value['jobs'][$value['jobid']]['name'] : lang('none'); + $data_depart[$key] = $value; + } + //$orgtree_admin=getDepartmentOption_admin(0); + if ($upjob = C::t('organization_upjob') -> fetch_by_uid($uid)) { + $upjob['jobs'] = C::t('organization_job') -> fetch_all_by_orgid($upjob['orgid']); + } else { + $upjob = array('jobid' => 0, 'depart' => lang('please_select_a_organization_or_department'), 'name' => lang('none')); + } + //$orgtree_all=getDepartmentOption_admin(0,'',true); + $perm = 1; + if ($user['groupid'] < $_G['groupid'] || (C::t('user') -> checkfounder($user) && !C::t('user') -> checkfounder($_G['member']))) { + $perm = 0; + } + + include template('edituser'); + } + +} elseif ($do == 'profile') { + //判断是否对此用户有管理权限 + $uperm = false; + if ($_G['adminid'] != 1) { + if ($orgids = C::t('organization_user') -> fetch_orgids_by_uid($uid)) { + foreach ($orgids as $orgid) { + if (C::t('organization_admin') -> ismoderator_by_uid_orgid($orgid, $_G['uid'])) { + $uperm = true; + break; + } + } + } + if (!$uperm) + exit(lang('orguser_edituser_add_user1')); + } + include_once libfile('function/profile', '', 'user'); + $space = getuserbyuid($uid); + space_merge($space, 'profile'); + loadcache('profilesetting'); + if (empty($_G['cache']['profilesetting'])) { + loadcache('profilesetting'); + } + if (submitcheck('profilesubmit')) { + $setarr = array(); + foreach ($_GET as $key => $value) { + $field = $_G['cache']['profilesetting'][$key]; + if (empty($field)) { + continue; + } elseif (profile_check($key, $value, $space)) { + $setarr[$key] = dhtmlspecialchars(trim($value)); + } + } + if (isset($_POST['birthmonth']) && ($space['birthmonth'] != $_POST['birthmonth'] || $space['birthday'] != $_POST['birthday'])) { + $setarr['constellation'] = get_constellation($_POST['birthmonth'], $_POST['birthday']); + } + if (isset($_POST['birthyear']) && $space['birthyear'] != $_POST['birthyear']) { + $setarr['zodiac'] = get_zodiac($_POST['birthyear']); + } + + if ($setarr) { + $setarr['uid'] = $uid; + C::t('user_profile') -> insert($setarr); + } + showmessage('subscriber_data_alter_success', MOD_URL.'#user_' . $uid . '_profile', array()); + } else { + $allowitems = array(); + foreach ($_G['cache']['profilesetting'] as $key => $value) { + if ($value['available'] > 0) + $allowitems[] = $key; + } + $htmls = $settings = array(); + foreach ($allowitems as $fieldid) { + if (!in_array($fieldid, array('department', 'timeoffset'))) { + $html = profile_setting($fieldid, $space, false, true); + if ($html) { + $settings[$fieldid] = $_G['cache']['profilesetting'][$fieldid]; + $htmls[$fieldid] = $html; + } + } + } + $active = array('profile' => 'class="active"'); + + include template('profile'); + } + +} +exit(); +?> diff --git a/admin/orguser/export.php b/admin/orguser/export.php new file mode 100644 index 0000000..c11eee5 --- /dev/null +++ b/admin/orguser/export.php @@ -0,0 +1,183 @@ +lang('compellation'),'email'=>lang('email'),'birth'=>lang('date_birth'),'gender'=>lang('gender'),'mobile'=>lang('cellphone'),'weixinid'=>lang('weixin'),'orgname'=>lang('category_department'),'job'=>lang('department_position')); + $h1=getProfileForImport(); + $h0=array_merge($h0,$h1); +$orgid=intval($_GET['orgid']); +if(!submitcheck('exportsubmit')){ + $orgpath=C::t('organization')->getPathByOrgid($orgid); + if(empty($orgpath)) $orgpath=lang('please_select_range_export'); + + //默认选中 + $open=array(); + $patharr=getPathByOrgid($orgid); + $arr=array_keys($patharr); + array_pop($arr); + $count=count($arr); + if($open[$arr[$count-1]]){ + if(count($open[$arr[$count-1]])>$count) $open[$arr[count($arr)-1]]=$arr; + }else{ + $open[$arr[$count-1]]=$arr; + } + $openarr=json_encode(array('orgid'=>$open)); + + include template('export'); + exit(); +}else{ + if(!is_array($_GET['item'])) showmessage('please_select_project_export',dreferer()); + foreach($h0 as $key=>$value){ + if(!in_array($key,$_GET['item'])) unset($h0[$key]); + } + $title=''; + if($org=C::t('organization')->fetch($orgid)){ + $orgids=getOrgidTree($org['orgid']); + if($org['forgid']>0){ + $toporgid=C::t('organization')->getTopOrgid($orgid); + $toporg=C::t('organization')->fetch($toporgid); + $title=$_G['setting']['sitename'].'-'.$toporg['orgname'].'-'.$org['orgname']; + }else{ + $title=$_G['setting']['sitename'].'-'.$org['orgname']; + } + }else{ + $title=$_G['setting']['sitename']; + } + + + $objPHPExcel = new PHPExcel(); + $objPHPExcel->getProperties()->setCreator($_G['username']) + ->setTitle($title.' - '.lang('user_information_table').' - DzzOffice') + ->setSubject($title.' - '.lang('user_information_table')) + ->setDescription($title.' - '.lang('user_information_table').' Export By DzzOffice '.date('Y-m-d H:i:s')) + ->setKeywords($title.' - '.lang('user_information_table')) + ->setCategory(lang('user_information_table')); + $list=array(); + // Create a first sheet + $objPHPExcel->setActiveSheetIndex(0); + $j=0; + foreach($h0 as $key =>$value){ + $index=getColIndex($j).'1'; + $objPHPExcel->getActiveSheet()->setCellValue($index,$value); + $list[1][$index]=$value; + $j++; + } + $i=2; + $wheresql=1; + if($orgid){ + $uids=C::t('organization_user')->fetch_uids_by_orgid($orgids); + $wheresql=" where uid IN (".dimplode($uids).")"; + }else{ + $wheresql=" where 1 "; + } + + foreach(DB::fetch_all("select * from %t $wheresql",array('user')) as $user){ + + $profile=C::t('user_profile')->fetch_all($user['uid']); + if($profile) $value=array_merge($user,$profile[$user['uid']]); + else $value=$user; + if($value['birthyear'] && $value['birthmonth'] && $value['birthday']) $value['birth']=$value['birthyear'] .'-'. $value['birthmonth'] .'-'. $value['birthday']; + if($value['gender']){ + if($value['gender']==2) $value['gender']=lang('woman'); + elseif($value['gender']==1) $value['gender']=lang('man'); + else $value['gender']=''; + } + //获取用户的部门和职位 + if($orgids=C::t('organization_user')->fetch_orgids_by_uid($value['uid'])){ + $k=0; + foreach($orgids as $key=> $gid){ + $orgpath=C::t('organization')->getPathByOrgid($gid); + $value['orgname']=str_replace('-','/',$orgpath); + if(empty($value['orgname'])) continue; + if($job=DB::fetch_first("select j.name from %t u LEFT JOIN %t j ON u.jobid=j.jobid where u.orgid=%d and u.uid=%d",array('organization_user','organization_job',$gid,$user['uid']))) $value['job']=$job['name']; + $j=0; + foreach($h0 as $key1 =>$fieldid){ + $index=getColIndex($j).intval($i+$k); + $objPHPExcel->getActiveSheet()->setCellValue($index,$value[$key1]); + $j++; + $list[$i+$k][$index]=$value[$key1]; + } + $k++; + } + $i+=$k-1; + }else{ + $j=0; + foreach($h0 as $key1 =>$fieldid){ + $index=getColIndex($j).($i); + $objPHPExcel->getActiveSheet()->setCellValue($index,$value[$key1]); + $j++; + $list[$i][$index]=$value[$key1]; + } + } + $i++; + } + $objPHPExcel->setActiveSheetIndex(0); + $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007'); + $filename=$_G['setting']['attachdir'].'./cache/'.random(5).'.xlsx'; + $objWriter->save($filename); + + + $name=$title.' - '.lang('user_information_table').'.xlsx'; + $name = '"'.(strtolower(CHARSET) == 'utf-8' && (strexists($_SERVER['HTTP_USER_AGENT'], 'MSIE') || strexists($_SERVER['HTTP_USER_AGENT'], 'rv:11')) ? urlencode($name) : $name).'"'; + + $filesize=filesize($filename); + $chunk = 10 * 1024 * 1024; + if(!$fp = @fopen($filename, 'rb')) { + exit(lang('export_failure')); + } + dheader('Date: '.gmdate('D, d M Y H:i:s', TIMESTAMP).' GMT'); + dheader('Last-Modified: '.gmdate('D, d M Y H:i:s', TIMESTAMP).' GMT'); + dheader('Content-Encoding: none'); + dheader('Content-Disposition: attachment; filename='.$name); + dheader('Content-Type: application/octet-stream'); + dheader('Content-Length: '.$filesize); + @ob_end_clean();if(getglobal('gzipcompress')) @ob_start('ob_gzhandler'); + while (!feof($fp)) { + echo fread($fp, $chunk); + @ob_flush(); // flush output + @flush(); + } + @unlink($filename); + exit(); +} +function getColIndex($index){ + $string="ABCDEFGHIJKLMNOPQRSTUVWXYZ"; + $ret=''; + if($index>255) return ''; + for($i=0;$i您收到这封邮件,是由于 $sitename 的管理员编辑成员信息时使用了这个邮箱地址。如果您不知道 $sitename 请忽略这封邮件。您不需要退订或进行其他进一步的操作。
+登录帐号和密码
+登录帐号:$email
+登录密码:$_GET[password]
+感谢您的访问,祝您使用愉快!
+EOT; + + if(!sendmail_cron("$_GET[username] <$email>", lang('email_password_subject'), $email_password_message)) { + runlog('sendmail', "$email 发送失败"); + } + } + } + }else{ //新添用户 + if(!check_username($_GET['username'])) exit(json_encode(array('error'=>lang('user_name_sensitive')))); + + + $user=uc_add_user($_GET['username'], $_GET['password'], $email); + + $uid=$user['uid']; + if($uid<1) exit(json_encode(array('error'=>lang('import_failure')))); + $base = array( + 'uid' => $uid, + 'adminid' => 0, + 'groupid' =>9, + 'regdate' => TIMESTAMP, + 'emailstatus' => 1, + ); + if($_GET['mobile']){ + if(!preg_match("/^\d+$/",$_GET['mobile'])){ + }elseif(C::t('user')->fetch_by_phone($_GET['mobile']) ) { + }else{ + $base['phone']=$_GET['mobile']; + } + } + if($_GET['weixinid']){ + if(!preg_match("/^[a-zA-Z\d_]{5,}$/i",$_GET['weixinid'])){ + }elseif(C::t('user')->fetch_by_weixinid($_GET['weixinid'])) { + }else{ + $base['weixinid']=$_GET['weixinid']; + } + } + $sitename=$_G['setting']['sitename']; + C::t('user')->update($uid,$base); + if($sendmail){ //发送密码到用户邮箱,延时发送 + $email_password_message = <<您收到这封邮件,是由于 $sitename 的管理员添加成员时使用了这个邮箱地址。如果您不知道 $sitename 请忽略这封邮件。您不需要退订或进行其他进一步的操作。
+登录帐号和密码
+登录帐号:$email
+登录密码:$_GET[password]
+感谢您的访问,祝您使用愉快!
+EOT; + + if(!sendmail_cron("$_GET[username] <$email>", lang('email_password_subject'), $email_password_message)) { + runlog('sendmail', "$email 发送失败"); + } + } + } + //处理用户资料 + $_GET['gender']=trim($_GET['gender']); + $_GET['birth']=trim($_GET['birth']); + $_GET['telephone']=trim($_GET['telephone']); + //$_GET['mobile']=trim($_GET['mobile']); + + if($exist && $isappend){ //增量时 + $oldprofile=C::t('user_profile')->fetch($uid); + $profile=array(); + if(!empty($_GET['birth']) && empty($oldprofile['birthyear'])){ + $birth=strtotime($_GET['birth']); + if($birth
{lang Select organization to set organization information}
{lang Select department to set department information}
{lang Select personnel to set personnel information}
{lang Key to move personnel or departments to copy. It is used to join personnel to multiple departments at the same time.}
{lang Key can be used for multiple selections, and release after multiple selections}
{lang Key movement is batch movement. Do not loosen}
{lang Key to move to batch copy.} {lang inport_guide_notice}
+
+
+
+
+
diff --git a/admin/setting/template/perm_group.htm b/admin/setting/template/perm_group.htm
index 25fdc0f..4668b58 100644
--- a/admin/setting/template/perm_group.htm
+++ b/admin/setting/template/perm_group.htm
@@ -63,7 +63,8 @@
$v[pername]
+
+ $v[pername]
{lang system_default}
@@ -130,7 +131,7 @@ var html ='
'+data['success']['pername']+'
' + data['success']['pername'] + ' '+''+
'请选择下列用户登录
+$scdlsj
+
$zcsj
+
+
$space['phone']$scdlsj已验证未验证$users[regip]$userstatus['lastip']