spacecp_profile.php 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522
  1. <?php
  2. /**
  3. * [Discuz!] (C)2001-2099 Comsenz Inc.
  4. * This is NOT a freeware, use is subject to license terms
  5. *
  6. * $Id: spacecp_profile.php 36284 2016-12-12 00:47:50Z nemohou $
  7. */
  8. if(!defined('IN_DISCUZ')) {
  9. exit('Access Denied');
  10. }
  11. $defaultop = '';
  12. $profilegroup = C::t('common_setting')->fetch('profilegroup', true);
  13. foreach($profilegroup as $key => $value) {
  14. if($value['available']) {
  15. $defaultop = $key;
  16. break;
  17. }
  18. }
  19. $operation = in_array($_GET['op'], array('base', 'contact', 'edu', 'work', 'info', 'password', 'verify')) ? trim($_GET['op']) : $defaultop;
  20. $space = getuserbyuid($_G['uid']);
  21. space_merge($space, 'field_home');
  22. space_merge($space, 'profile');
  23. list($seccodecheck, $secqaacheck) = seccheck('password');
  24. @include_once DISCUZ_ROOT.'./data/cache/cache_domain.php';
  25. $spacedomain = isset($rootdomain['home']) && $rootdomain['home'] ? $rootdomain['home'] : array();
  26. $_GET['id'] = $_GET['id'] ? preg_replace("/[^A-Za-z0-9_:]/", '', $_GET['id']) : '';
  27. if($operation != 'password') {
  28. include_once libfile('function/profile');
  29. loadcache('profilesetting');
  30. if(empty($_G['cache']['profilesetting'])) {
  31. require_once libfile('function/cache');
  32. updatecache('profilesetting');
  33. loadcache('profilesetting');
  34. }
  35. }
  36. $allowcstatus = !empty($_G['group']['allowcstatus']) ? true : false;
  37. $verify = C::t('common_member_verify')->fetch($_G['uid']);
  38. $validate = array();
  39. if($_G['setting']['regverify'] == 2 && $_G['groupid'] == 8) {
  40. $validate = C::t('common_member_validate')->fetch($_G['uid']);
  41. if(empty($validate) || $validate['status'] != 1) {
  42. $validate = array();
  43. }
  44. }
  45. if($_G['setting']['connect']['allow']) {
  46. $connect = C::t('#qqconnect#common_member_connect')->fetch($_G['uid']);
  47. $conisregister = $operation == 'password' && $connect['conisregister'];
  48. }
  49. if(in_array('wechat', $_G['setting']['plugins']['available'])) {
  50. if($_G['wechat']['setting']['wechat_qrtype']) {
  51. $wechatuser = C::t('#wechat#common_member_wechatmp')->fetch($_G['uid']);
  52. if($wechatuser && !$wechatuser['status']) {
  53. $wechatuser['isregister'] = 1;
  54. }
  55. } else {
  56. $wechatuser = C::t('#wechat#common_member_wechat')->fetch($_G['uid']);
  57. }
  58. $conisregister = $operation == 'password' && $wechatuser['isregister'];
  59. }
  60. if(submitcheck('profilesubmit')) {
  61. require_once libfile('function/discuzcode');
  62. $forum = $setarr = $verifyarr = $errorarr = array();
  63. $forumfield = array('customstatus', 'sightml');
  64. $censor = discuz_censor::instance();
  65. if($_GET['vid']) {
  66. $vid = intval($_GET['vid']);
  67. $verifyconfig = $_G['setting']['verify'][$vid];
  68. if($verifyconfig['available'] && (empty($verifyconfig['groupid']) || in_array($_G['groupid'], $verifyconfig['groupid']))) {
  69. $verifyinfo = C::t('common_member_verify_info')->fetch_by_uid_verifytype($_G['uid'], $vid);
  70. if(!empty($verifyinfo)) {
  71. $verifyinfo['field'] = dunserialize($verifyinfo['field']);
  72. }
  73. foreach($verifyconfig['field'] as $key => $field) {
  74. if(!isset($verifyinfo['field'][$key])) {
  75. $verifyinfo['field'][$key] = $key;
  76. }
  77. }
  78. } else {
  79. $_GET['vid'] = $vid = 0;
  80. $verifyconfig = array();
  81. }
  82. }
  83. if(isset($_POST['birthprovince'])) {
  84. $initcity = array('birthprovince', 'birthcity', 'birthdist', 'birthcommunity');
  85. foreach($initcity as $key) {
  86. $_GET[''.$key] = $_POST[$key] = !empty($_POST[$key]) ? $_POST[$key] : '';
  87. }
  88. }
  89. if(isset($_POST['resideprovince'])) {
  90. $initcity = array('resideprovince', 'residecity', 'residedist', 'residecommunity');
  91. foreach($initcity as $key) {
  92. $_GET[''.$key] = $_POST[$key] = !empty($_POST[$key]) ? $_POST[$key] : '';
  93. }
  94. }
  95. foreach($_POST as $key => $value) {
  96. $field = $_G['cache']['profilesetting'][$key];
  97. if(in_array($field['formtype'], array('text', 'textarea')) || in_array($key, $forumfield)) {
  98. $censor->check($value);
  99. if($censor->modbanned() || $censor->modmoderated()) {
  100. profile_showerror($key, lang('spacecp', 'profile_censor'));
  101. }
  102. }
  103. if(in_array($key, $forumfield)) {
  104. if($key == 'sightml') {
  105. loadcache(array('smilies', 'smileytypes'));
  106. $value = cutstr($value, $_G['group']['maxsigsize'], '');
  107. foreach($_G['cache']['smilies']['replacearray'] AS $skey => $smiley) {
  108. $_G['cache']['smilies']['replacearray'][$skey] = '[img]'.$_G['siteurl'].'static/image/smiley/'.$_G['cache']['smileytypes'][$_G['cache']['smilies']['typearray'][$skey]]['directory'].'/'.$smiley.'[/img]';
  109. }
  110. $value = preg_replace($_G['cache']['smilies']['searcharray'], $_G['cache']['smilies']['replacearray'], trim($value));
  111. $forum[$key] = discuzcode($value, 1, 0, 0, 0, $_G['group']['allowsigbbcode'], $_G['group']['allowsigimgcode'], 0, 0, 1);
  112. } elseif($key=='customstatus' && $allowcstatus) {
  113. $forum[$key] = dhtmlspecialchars(trim($value));
  114. }
  115. continue;
  116. } elseif($field && !$field['available']) {
  117. continue;
  118. } elseif($key == 'timeoffset') {
  119. if($value >= -12 && $value <= 12 || $value == 9999) {
  120. C::t('common_member')->update($_G['uid'], array('timeoffset' => intval($value)));
  121. }
  122. } elseif($key == 'site') {
  123. if(!in_array(strtolower(substr($value, 0, 6)), array('http:/', 'https:', 'ftp://', 'rtsp:/', 'mms://')) && !preg_match('/^static\//', $value) && !preg_match('/^data\//', $value)) {
  124. $value = 'http://'.$value;
  125. }
  126. }
  127. if($field['formtype'] == 'file') {
  128. if((!empty($_FILES[$key]) && $_FILES[$key]['error'] == 0) || (!empty($space[$key]) && empty($_GET['deletefile'][$key]))) {
  129. $value = '1';
  130. } else {
  131. $value = '';
  132. }
  133. }
  134. if(empty($field)) {
  135. continue;
  136. } elseif(profile_check($key, $value, $space)) {
  137. $setarr[$key] = dhtmlspecialchars(trim($value));
  138. } else {
  139. if($key=='birthprovince') {
  140. $key = 'birthcity';
  141. } elseif($key=='resideprovince' || $key=='residecommunity'||$key=='residedist') {
  142. $key = 'residecity';
  143. } elseif($key=='birthyear' || $key=='birthmonth') {
  144. $key = 'birthday';
  145. }
  146. profile_showerror($key);
  147. }
  148. if($field['formtype'] == 'file') {
  149. unset($setarr[$key]);
  150. }
  151. if($vid && $verifyconfig['available'] && isset($verifyconfig['field'][$key])) {
  152. if(isset($verifyinfo['field'][$key]) && $setarr[$key] !== $space[$key]) {
  153. $verifyarr[$key] = $setarr[$key];
  154. }
  155. unset($setarr[$key]);
  156. }
  157. if(isset($setarr[$key]) && $_G['cache']['profilesetting'][$key]['needverify']) {
  158. if($setarr[$key] !== $space[$key]) {
  159. $verifyarr[$key] = $setarr[$key];
  160. }
  161. unset($setarr[$key]);
  162. }
  163. }
  164. if($_GET['deletefile'] && is_array($_GET['deletefile'])) {
  165. foreach($_GET['deletefile'] as $key => $value) {
  166. if(isset($_G['cache']['profilesetting'][$key]) && $_G['cache']['profilesetting'][$key]['formtype'] == 'file') {
  167. @unlink(getglobal('setting/attachdir').'./profile/'.$space[$key]);
  168. @unlink(getglobal('setting/attachdir').'./profile/'.$verifyinfo['field'][$key]);
  169. $verifyarr[$key] = $setarr[$key] = '';
  170. }
  171. }
  172. }
  173. if($_FILES) {
  174. $upload = new discuz_upload();
  175. foreach($_FILES as $key => $file) {
  176. if(!isset($_G['cache']['profilesetting'][$key])) {
  177. continue;
  178. }
  179. $field = $_G['cache']['profilesetting'][$key];
  180. if((!empty($file) && $file['error'] == 0) || (!empty($space[$key]) && empty($_GET['deletefile'][$key]))) {
  181. $value = '1';
  182. } else {
  183. $value = '';
  184. }
  185. if(!profile_check($key, $value, $space)) {
  186. profile_showerror($key);
  187. } elseif($field['size'] && $field['size']*1024 < $file['size']) {
  188. profile_showerror($key, lang('spacecp', 'filesize_lessthan').$field['size'].'KB');
  189. }
  190. $upload->init($file, 'profile');
  191. $attach = $upload->attach;
  192. if(!$upload->error()) {
  193. $upload->save();
  194. if(!$upload->get_image_info($attach['target'])) {
  195. @unlink($attach['target']);
  196. continue;
  197. }
  198. $setarr[$key] = '';
  199. $attach['attachment'] = dhtmlspecialchars(trim($attach['attachment']));
  200. if($vid && $verifyconfig['available'] && isset($verifyconfig['field'][$key])) {
  201. if(isset($verifyinfo['field'][$key])) {
  202. @unlink(getglobal('setting/attachdir').'./profile/'.$verifyinfo['field'][$key]);
  203. $verifyarr[$key] = $attach['attachment'];
  204. }
  205. continue;
  206. }
  207. if(isset($setarr[$key]) && $_G['cache']['profilesetting'][$key]['needverify']) {
  208. @unlink(getglobal('setting/attachdir').'./profile/'.$verifyinfo['field'][$key]);
  209. $verifyarr[$key] = $attach['attachment'];
  210. continue;
  211. }
  212. @unlink(getglobal('setting/attachdir').'./profile/'.$space[$key]);
  213. $setarr[$key] = $attach['attachment'];
  214. }
  215. }
  216. }
  217. if($vid && !empty($verifyinfo['field']) && is_array($verifyinfo['field'])) {
  218. foreach($verifyinfo['field'] as $key => $fvalue) {
  219. if(!isset($verifyconfig['field'][$key])) {
  220. unset($verifyinfo['field'][$key]);
  221. continue;
  222. }
  223. if(empty($verifyarr[$key]) && !isset($verifyarr[$key]) && isset($verifyinfo['field'][$key])) {
  224. $verifyarr[$key] = !empty($fvalue) && $key != $fvalue ? $fvalue : $space[$key];
  225. }
  226. }
  227. }
  228. if($forum) {
  229. if(!$_G['group']['maxsigsize']) {
  230. $forum['sightml'] = '';
  231. }
  232. C::t('common_member_field_forum')->update($_G['uid'], $forum);
  233. }
  234. if(isset($_POST['birthmonth']) && ($space['birthmonth'] != $_POST['birthmonth'] || $space['birthday'] != $_POST['birthday'])) {
  235. $setarr['constellation'] = get_constellation($_POST['birthmonth'], $_POST['birthday']);
  236. }
  237. if(isset($_POST['birthyear']) && $space['birthyear'] != $_POST['birthyear']) {
  238. $setarr['zodiac'] = get_zodiac($_POST['birthyear']);
  239. }
  240. if($setarr) {
  241. C::t('common_member_profile')->update($_G['uid'], $setarr);
  242. }
  243. if($verifyarr) {
  244. C::t('common_member_verify_info')->delete_by_uid($_G['uid'], $vid);
  245. $setverify = array(
  246. 'uid' => $_G['uid'],
  247. 'username' => $_G['username'],
  248. 'verifytype' => $vid,
  249. 'field' => serialize($verifyarr),
  250. 'dateline' => $_G['timestamp']
  251. );
  252. C::t('common_member_verify_info')->insert($setverify);
  253. if(!(C::t('common_member_verify')->count_by_uid($_G['uid']))) {
  254. C::t('common_member_verify')->insert(array('uid' => $_G['uid']));
  255. }
  256. if($_G['setting']['verify'][$vid]['available']) {
  257. manage_addnotify('verify_'.$vid, 0, array('langkey' => 'manage_verify_field', 'verifyname' => $_G['setting']['verify'][$vid]['title'], 'doid' => $vid));
  258. }
  259. }
  260. if(isset($_POST['privacy'])) {
  261. foreach($_POST['privacy'] as $key=>$value) {
  262. if(isset($_G['cache']['profilesetting'][$key])) {
  263. $space['privacy']['profile'][$key] = intval($value);
  264. }
  265. }
  266. C::t('common_member_field_home')->update($space['uid'], array('privacy'=>serialize($space['privacy'])));
  267. }
  268. manyoulog('user', $_G['uid'], 'update');
  269. include_once libfile('function/feed');
  270. feed_add('profile', 'feed_profile_update_'.$operation, array('hash_data'=>'profile'));
  271. countprofileprogress();
  272. $message = $vid ? lang('spacecp', 'profile_verify_verifying', array('verify' => $verifyconfig['title'])) : '';
  273. profile_showsuccess($message);
  274. } elseif(submitcheck('passwordsubmit', 0, $seccodecheck, $secqaacheck)) {
  275. $membersql = $memberfieldsql = $authstradd1 = $authstradd2 = $newpasswdadd = '';
  276. $setarr = array();
  277. $emailnew = dhtmlspecialchars($_GET['emailnew']);
  278. $ignorepassword = 0;
  279. if($_G['setting']['connect']['allow']) {
  280. $connect = C::t('#qqconnect#common_member_connect')->fetch($_G['uid']);
  281. if($connect['conisregister']) {
  282. $_GET['oldpassword'] = '';
  283. $ignorepassword = 1;
  284. if(empty($_GET['newpassword'])) {
  285. showmessage('profile_passwd_empty');
  286. }
  287. }
  288. }
  289. if(in_array('mobile', $_G['setting']['plugins']['available']) && $wechatuser['isregister']) {
  290. $_GET['oldpassword'] = '';
  291. $ignorepassword = 1;
  292. if(empty($_GET['newpassword'])) {
  293. showmessage('profile_passwd_empty');
  294. }
  295. }
  296. if($_GET['questionidnew'] === '') {
  297. $_GET['questionidnew'] = $_GET['answernew'] = '';
  298. } else {
  299. $secquesnew = $_GET['questionidnew'] > 0 ? random(8) : '';
  300. }
  301. if(!empty($_GET['newpassword']) && $_G['setting']['strongpw']) {
  302. $strongpw_str = array();
  303. if(in_array(1, $_G['setting']['strongpw']) && !preg_match("/\d+/", $_GET['newpassword'])) {
  304. $strongpw_str[] = lang('member/template', 'strongpw_1');
  305. }
  306. if(in_array(2, $_G['setting']['strongpw']) && !preg_match("/[a-z]+/", $_GET['newpassword'])) {
  307. $strongpw_str[] = lang('member/template', 'strongpw_2');
  308. }
  309. if(in_array(3, $_G['setting']['strongpw']) && !preg_match("/[A-Z]+/", $_GET['newpassword'])) {
  310. $strongpw_str[] = lang('member/template', 'strongpw_3');
  311. }
  312. if(in_array(4, $_G['setting']['strongpw']) && !preg_match("/[^a-zA-z0-9]+/", $_GET['newpassword'])) {
  313. $strongpw_str[] = lang('member/template', 'strongpw_4');
  314. }
  315. if($strongpw_str) {
  316. showmessage(lang('member/template', 'password_weak').implode(',', $strongpw_str));
  317. }
  318. }
  319. if(!empty($_GET['newpassword']) && $_GET['newpassword'] != addslashes($_GET['newpassword'])) {
  320. showmessage('profile_passwd_illegal', '', array(), array('return' => true));
  321. }
  322. if(!empty($_GET['newpassword']) && $_GET['newpassword'] != $_GET['newpassword2']) {
  323. showmessage('profile_passwd_notmatch', '', array(), array('return' => true));
  324. }
  325. loaducenter();
  326. if($emailnew != $_G['member']['email']) {
  327. include_once libfile('function/member');
  328. checkemail($emailnew);
  329. }
  330. $ucresult = uc_user_edit(addslashes($_G['username']), $_GET['oldpassword'], $_GET['newpassword'], '', $ignorepassword, $_GET['questionidnew'], $_GET['answernew']);
  331. if($ucresult == -1) {
  332. showmessage('profile_passwd_wrong', '', array(), array('return' => true));
  333. } elseif($ucresult == -4) {
  334. showmessage('profile_email_illegal', '', array(), array('return' => true));
  335. } elseif($ucresult == -5) {
  336. showmessage('profile_email_domain_illegal', '', array(), array('return' => true));
  337. } elseif($ucresult == -6) {
  338. showmessage('profile_email_duplicate', '', array(), array('return' => true));
  339. }
  340. if(!empty($_GET['newpassword']) || $secquesnew) {
  341. $setarr['password'] = md5(random(10));
  342. }
  343. if($_G['setting']['connect']['allow']) {
  344. C::t('#qqconnect#common_member_connect')->update($_G['uid'], array('conisregister' => 0));
  345. }
  346. if(in_array('mobile', $_G['setting']['plugins']['available']) && $wechatuser['isregister']) {
  347. C::t('#wechat#common_member_wechat')->update($_G['uid'], array('isregister' => 0));
  348. }
  349. $authstr = false;
  350. if($emailnew != $_G['member']['email']) {
  351. $authstr = true;
  352. emailcheck_send($space['uid'], $emailnew);
  353. dsetcookie('newemail', "$space[uid]\t$emailnew\t$_G[timestamp]", 31536000);
  354. }
  355. if($setarr) {
  356. if($_G['member']['freeze'] == 1) {
  357. $setarr['freeze'] = 0;
  358. }
  359. C::t('common_member')->update($_G['uid'], $setarr);
  360. }
  361. if($_G['member']['freeze'] == 2) {
  362. C::t('common_member_validate')->update($_G['uid'], array('message' => dhtmlspecialchars($_G['gp_freezereson'])));
  363. }
  364. if($authstr) {
  365. showmessage('profile_email_verify', 'home.php?mod=spacecp&ac=profile&op=password');
  366. } else {
  367. showmessage('profile_succeed', 'home.php?mod=spacecp&ac=profile&op=password');
  368. }
  369. }
  370. if($operation == 'password') {
  371. $resend = getcookie('resendemail');
  372. $resend = empty($resend) ? true : (TIMESTAMP - $resend) > 300;
  373. $newemail = getcookie('newemail');
  374. $space['newemail'] = !$space['emailstatus'] ? $space['email'] : '';
  375. if(!empty($newemail)) {
  376. $mailinfo = explode("\t", $newemail);
  377. $space['newemail'] = $mailinfo[0] == $_G['uid'] && isemail($mailinfo[1]) ? $mailinfo[1] : '';
  378. }
  379. if($_GET['resend'] && $resend) {
  380. $toemail = $space['newemail'] ? $space['newemail'] : $space['email'];
  381. emailcheck_send($space['uid'], $toemail);
  382. dsetcookie('newemail', "$space[uid]\t$toemail\t$_G[timestamp]", 31536000);
  383. dsetcookie('resendemail', TIMESTAMP);
  384. showmessage('send_activate_mail_succeed', "home.php?mod=spacecp&ac=profile&op=password");
  385. } elseif ($_GET['resend']) {
  386. showmessage('send_activate_mail_error', "home.php?mod=spacecp&ac=profile&op=password");
  387. }
  388. if(!empty($space['newemail'])) {
  389. $acitvemessage = lang('spacecp', 'email_acitve_message', array('newemail' => $space['newemail'], 'imgdir' => $_G['style']['imgdir']));
  390. }
  391. $actives = array('password' =>' class="a"');
  392. $navtitle = lang('core', 'title_password_security');
  393. if($_G['member']['freeze'] == 2) {
  394. $fzvalidate = C::t('common_member_validate')->fetch($space['uid']);
  395. $space['freezereson'] = $fzvalidate['message'];
  396. }
  397. } else {
  398. space_merge($space, 'field_home');
  399. space_merge($space, 'field_forum');
  400. require_once libfile('function/editor');
  401. $space['sightml'] = html2bbcode($space['sightml']);
  402. $vid = $_GET['vid'] ? intval($_GET['vid']) : 0;
  403. $privacy = $space['privacy']['profile'] ? $space['privacy']['profile'] : array();
  404. $_G['setting']['privacy'] = $_G['setting']['privacy'] ? $_G['setting']['privacy'] : array();
  405. $_G['setting']['privacy'] = is_array($_G['setting']['privacy']) ? $_G['setting']['privacy'] : dunserialize($_G['setting']['privacy']);
  406. $_G['setting']['privacy']['profile'] = !empty($_G['setting']['privacy']['profile']) ? $_G['setting']['privacy']['profile'] : array();
  407. $privacy = array_merge($_G['setting']['privacy']['profile'], $privacy);
  408. $actives = array('profile' =>' class="a"');
  409. $opactives = array($operation =>' class="a"');
  410. $allowitems = array();
  411. if(in_array($operation, array('base', 'contact', 'edu', 'work', 'info'))) {
  412. $allowitems = $profilegroup[$operation]['field'];
  413. } elseif($operation == 'verify') {
  414. if($vid == 0) {
  415. foreach($_G['setting']['verify'] as $key => $setting) {
  416. if($setting['available'] && (empty($setting['groupid']) || in_array($_G['groupid'], $setting['groupid']))) {
  417. $_GET['vid'] = $vid = $key;
  418. break;
  419. }
  420. }
  421. }
  422. if(empty($_G['setting']['verify'][$vid]['groupid']) || in_array($_G['groupid'], $_G['setting']['verify'][$vid]['groupid'])) {
  423. $actives = array('verify' =>' class="a"');
  424. $opactives = array($operation.$vid =>' class="a"');
  425. $allowitems = $_G['setting']['verify'][$vid]['field'];
  426. }
  427. }
  428. $showbtn = ($vid && $verify['verify'.$vid] != 1) || empty($vid);
  429. if(!empty($verify) && is_array($verify)) {
  430. foreach($verify as $key => $flag) {
  431. if(in_array($key, array('verify1', 'verify2', 'verify3', 'verify4', 'verify5', 'verify6', 'verify7')) && $flag == 1) {
  432. $verifyid = intval(substr($key, -1, 1));
  433. if($_G['setting']['verify'][$verifyid]['available']) {
  434. foreach($_G['setting']['verify'][$verifyid]['field'] as $field) {
  435. $_G['cache']['profilesetting'][$field]['unchangeable'] = 1;
  436. }
  437. }
  438. }
  439. }
  440. }
  441. if($vid) {
  442. if($value = C::t('common_member_verify_info')->fetch_by_uid_verifytype($_G['uid'], $vid)) {
  443. $field = dunserialize($value['field']);
  444. foreach($field as $key => $fvalue) {
  445. $space[$key] = $fvalue;
  446. }
  447. }
  448. }
  449. $htmls = $settings = array();
  450. foreach($allowitems as $fieldid) {
  451. if(!in_array($fieldid, array('sightml', 'customstatus', 'timeoffset'))) {
  452. $html = profile_setting($fieldid, $space, $vid ? false : true);
  453. if($html) {
  454. $settings[$fieldid] = $_G['cache']['profilesetting'][$fieldid];
  455. $htmls[$fieldid] = $html;
  456. }
  457. }
  458. }
  459. }
  460. include template("home/spacecp_profile");
  461. function profile_showerror($key, $extrainfo = '') {
  462. echo '<script>';
  463. echo 'parent.show_error("'.$key.'", "'.$extrainfo.'");';
  464. echo '</script>';
  465. exit();
  466. }
  467. function profile_showsuccess($message = '') {
  468. echo '<script type="text/javascript">';
  469. echo "parent.show_success('$message');";
  470. echo '</script>';
  471. exit();
  472. }
  473. ?>