public static function RecvPortraits($input_name, $img_id, $dir, $hash_type = 'null') { if (GlobalCore::disuploadedfile($_FILES[$input_name]['tmp_name']) && $_FILES[$input_name]['tmp_name'] != 'none' && $_FILES[$input_name]['tmp_name'] && trim($_FILES[$input_name]['name'])) { $pic_extarray = array('gif', 'jpg', 'png'); $_FILES[$input_name]['name'] = GlobalCore::chobits_addslashes($_FILES[$input_name]['name']); $pic_ext = strtolower(GlobalCore::fileext($_FILES[$input_name]['name'])); if (is_array($pic_extarray) && !in_array($pic_ext, $pic_extarray)) { GlobalCore::showmessage('profile_avatar_invalid'); } if ($hash_type == 'id') { $filename = $img_id; $pic = $dir . '/l/' . GlobalCore::mkdir_by_uid($img_id, NOWHERE_ROOT . $dir . '/l') . '/' . $filename . '.' . $pic_ext; } else { $filename = $img_id . '_' . GlobalCore::random(5); $pic = $dir . '/l/' . GlobalCore::mkdir_hash($img_id, NOWHERE_ROOT . $dir . '/l') . '/' . $filename . '.' . $pic_ext; } $pic_target = NOWHERE_ROOT . './' . $pic; if (!@copy($_FILES[$input_name]['tmp_name'], $pic_target)) { @move_uploaded_file($_FILES[$input_name]['tmp_name'], $pic_target); } if (file_exists($pic_target)) { $port['pic'] = $pic; $port['filename'] = $filename; $port['pic_target'] = $pic_target; $port['pic_ext'] = $pic_ext; return $port; } } }
GlobalCore::clearcookies(); $sessionexists = 1; } } } if (!$sessionexists) { if ($nw_uid) { if (!($_DSESSION = $db->fetch_first("SELECT {$membertablefields}\r\n \t\t\tFROM {$tablepre}members m WHERE m.uid='{$nw_uid}' AND m.password='******'"))) { GlobalCore::clearcookies(); } } if (GlobalCore::ipbanned($onlineip)) { $_DSESSION['ipbanned'] = 1; } $_DSESSION['sid'] = GlobalCore::random(6); $_DSESSION['seccode'] = GlobalCore::random(6, 1); } $_DSESSION['dateformat'] = empty($_DSESSION['dateformat']) ? $_CHOBITS['settings']['dateformat'] : $_DSESSION['dateformat']; $_DSESSION['timeformat'] = empty($_DSESSION['timeformat']) ? $_CHOBITS['settings']['timeformat'] : ($_DSESSION['timeformat'] == 1 ? 'h:i A' : 'H:i'); $_DSESSION['timeoffset'] = isset($_DSESSION['timeoffset']) && $_DSESSION['timeoffset'] != 9999 ? $_DSESSION['timeoffset'] : $_CHOBITS['settings']['timeoffset']; $membertablefields = ''; @extract($_DSESSION); $lastvisit = empty($lastvisit) ? $timestamp - 86400 : $lastvisit; $timenow = array('time' => gmdate("{$dateformat} {$timeformat}", $timestamp + 3600 * $timeoffset), 'offset' => $timeoffset >= 0 ? $timeoffset == 0 ? '' : '+' . $timeoffset : $timeoffset); if (PHP_VERSION > '5.1') { @date_default_timezone_set('Etc/GMT' . ($timeoffset > 0 ? '-' : '+') . abs($timeoffset)); } if (empty($nw_uid) || empty($nw_user)) { $show_cloud = 0; $nw_user = $nw_nick = ''; $nw_uid = $adminid = 0;