function display_finish($password) { $data = finish_installation($password); ?> <h2 class="target"><?php _e('Congratulations!'); ?> </h2> <p class="space-left-10"><?php _e('OSClass has been installed. Were you expecting more steps? Sorry to disappoint.'); ?> </p> <p class="space-left-10"><?php echo sprintf(__('An e-mail with the password for oc-admin has been sent to: %s'), $data['s_email']); ?> </p> <div style="clear:both;"></div> <div class="form-table finish"> <table> <tbody> <tr> <th><label><?php _e('Username'); ?> </label></th> <td> <div class="s_name"> <span style="float:left;" ><?php echo $data['admin_user']; ?> </span> </div> </td> </tr> <tr> <th><label><?php _e('Password'); ?> </label></th> <td> <div class="s_passwd"> <span style="float: left;"><?php echo osc_esc_html($data['password']); ?> </span> </div> </td> </tr> </tbody> </table> </div> <p class="margin20"> <a target="_blank" href="<?php echo get_absolute_url(); ?> oc-admin/index.php" class="button"><?php _e('Finish and go to the administration panel'); ?> </a> </p> <?php }
function save_remote_img($content) { if (preg_match_all('#<img .*?src="(.+?)".*?>#i', $content, $matches)) { foreach ($matches[1] as $img) { $img_host = parse_url($img, PHP_URL_HOST); if (empty($img_host) || strtolower($img_host) == strtolower($_SERVER['HTTP_HOST'])) { continue; } $new_name = microtime(true) . '_' . basename($img); $mappath = UPLOAD_PATH . $new_name; $client = new WebClient(NULL, 10); $img_data = $client->get($img); @mkdir(UPLOAD_PATH, 0777, true); if (!empty($img_data) && file_put_contents($mappath, $img_data)) { $content = str_replace($img, get_absolute_url(UPLOAD_PATH_WWW . $new_name), $content); } } } return $content; }
function display_finish($password) { $data = finish_installation($password); ?> <?php if (Params::getParam('error_location') == 1) { ?> <script type="text/javascript"> setTimeout (function(){ $('.error-location').fadeOut('slow'); }, 2500); </script> <div class="error-location"> <?php _e('The selected location could not been installed'); ?> </div> <?php } ?> <h2 class="target"><?php _e('Congratulations!'); ?> </h2> <p class="space-left-10"><?php _e("Osclass has been installed. Were you expecting more steps? Sorry to disappoint you!"); ?> </p> <p class="space-left-10"><?php echo sprintf(__('An e-mail with the password for oc-admin has been sent to: %s'), $data['s_email']); ?> </p> <div style="clear:both;"></div> <div class="form-table finish"> <table> <tbody> <tr> <th><span class="label-like"><?php _e('Username'); ?> </span></th> <td> <div class="s_name"> <span style="float:left;" ><?php echo $data['admin_user']; ?> </span> </div> </td> </tr> <tr> <th><span class="label-like"><?php _e('Password'); ?> </span></th> <td> <div class="s_passwd"> <span style="float: left;"><?php echo osc_esc_html($data['password']); ?> </span> </div> </td> </tr> </tbody> </table> </div> <p class="margin20"> <a target="_blank" href="<?php echo get_absolute_url(); ?> oc-admin/index.php" class="button"><?php _e('Finish and go to the administration panel'); ?> </a> </p> <?php }
function display_finish() { $data = finish_installation(); ?> <h2 class="target">Congratulations!</h2> <p class="space-left-10">OSClass has been installed. Were you expecting more steps? Sorry to disappoint.</p> <p class="space-left-10">An e-mail with the password for oc-admin has sent to: <?php echo $data['s_email']; ?> </p> <div class="form-table finish"> <table> <tbody> <tr> <th><label>Username</label></th> <td><?php echo $data['admin_user']; ?> </td> </tr> <tr> <th><label>Password</label></th> <td><p><?php echo $data['password']; ?> </p></td> </tr> <tr> <th></th> <td>Note that password carefully! It is a random password that was generated just for you.</td> </tr> </tbody> </table> </div> <p class="margin20"> <a target="_blank" href="<?php echo get_absolute_url(); ?> oc-admin/index.php" class="button">Finish and go to the administration panel</a> </p> <?php }
$TEMPLATE['error'] = array(); if ($ret) { $TEMPLATE['error']['username'] = '******'; } else { $tableInfo = array('username' => $fields['username'], 'password' => md5($fields['password']), 'type' => $user->totals() == 0 ? 1 : 0, 'reg_date' => time(), 'last_login' => time()); $newid = $user->insertIgnore($tableInfo); if ($newid) { $ret = Passport::WriteCookie($newid, $tableInfo['username'], $tableInfo['type']); $return_url = get_returnurl('index.php'); $wt_open = new WTOpen(); $cbs = $wt_open->getCallbackList(); $scripts = ''; if (count($cbs) > 0) { $token = http_build_query($ret); foreach ($cbs as $value) { $url = get_absolute_url("login_api.php?{$token}", $value); $scripts .= "<script src=\"{$url}\"></script>\n"; } } echo <<<HTML {$scripts} <script> location.replace('{$return_url}'); </script> HTML; exit; redirect(get_returnurl('index.php')); } else { $TEMPLATE['error']['username'] = '******'; } }
display_target(); } else { display_database_error($error, $step - 1); } } elseif ($step == 4) { display_categories(); } elseif ($step == 5) { display_finish(); } ?> </div> <div id="footer"> <ul> <li> <a href="<?php echo get_absolute_url(); ?> readme.php" target="_blank">Readme</a> </li> <li> <a href="http://osclass.org/contact/" target="_blank">Feedback</a> </li> <li> <a href="http://forums.osclass.org/index.php" target="_blank">Forums</a> </li> </ul> </div> </div> </div> </body> </html>
<?php include_once dirname(__FILE__) . DIRECTORY_SEPARATOR . 'init.php'; function get_absolute_url($filename, $host = NULL) { if ($host) { $parts = parse_url($host); if ($parts['host']) { $host = $parts['host']; } } else { $host = $_SERVER['HTTP_HOST']; } $path = dirname($_SERVER['REQUEST_URI']); return "http://{$host}{$path}/{$filename}"; } $data = $_POST['dataUrl']; $data = str_replace('data:image/png;base64,', '', $data); $imgData = base64_decode($data); @mkdir(UPLOAD_PATH, 0777, true); $new_filename = microtime(true) . '_' . '.png'; $upload_file = UPLOAD_PATH . $new_filename; file_put_contents($upload_file, $imgData); echo get_absolute_url(UPLOAD_PATH_WWW . $new_filename);
function relative_redirect($relative_url) { header("Location: " . get_absolute_url($relative_url)); exit; }
function reply_package_zip($leaf) { if (preg_match('/((.*?)-.*\\.zip)/', $leaf, $matches) > 0) { $edition_id = $matches[2]; $url = '../../' . get_package_path($edition_id) . $leaf; $base = get_current_url(); $absolute_url = get_absolute_url($url, $base); header('Content-Type: application/octet-stream'); header("Content-Disposition: attachment; filename={$leaf}"); $ch = curl_init($absolute_url); if (!empty($_SERVER['PHP_AUTH_USER']) && !empty($_SERVER['PHP_AUTH_PW'])) { curl_setopt($ch, CURLOPT_USERPWD, $_SERVER['PHP_AUTH_USER'] . ':' . $_SERVER['PHP_AUTH_PW']); } curl_exec($ch); curl_close($ch); } }
function display_finish($password) { $data = finish_installation($password); ?> <?php if (Params::getParam('error_location') == 1) { ?> <script type="text/javascript"> setTimeout (function(){ $('.error-location').fadeOut('slow'); }, 2500); </script> <div class="error-location"> <?php _e('Выбранные регионы невозможно установить!'); ?> </div> <?php } ?> <h2 class="target"><?php _e('Поздравляем!'); ?> </h2> <p class="space-left-10"><?php _e("OSClass Rus Team успешно установлен. Теперь перейдите в панель администрирования, установите язык и начните работать с системой!"); ?> </p> <p class="space-left-10"><?php echo sprintf(__('На ваш e-mail отправлено письмо с вашим паролем к панели администрирования oc-admin: %s'), $data['s_email']); ?> </p> <p class="space-left-10"><?php _e('Вам понравился Osclass помогите развивать проект! Скажите СПАСИБО'); ?> </p> <p class="space-left-10"> <form action="https://advisor.wmtransfer.com/Spasibo.aspx" method="post" target="_blank" title="Передать $пасибо! нашему сайту"> <input type="hidden" name="url" value="http://os-class.ru"/> <input type="image" src="//advisor.wmtransfer.com/img/Spasibo!.png" border="0" name="submit"/> </form> </p> <div style="clear:both;"></div> <div class="form-table finish"> <table> <tbody> <tr> <th><span class="label-like"><?php _e('Пользователь'); ?> </span></th> <td> <div class="s_name"> <span style="float:left;" ><?php echo $data['admin_user']; ?> </span> </div> </td> </tr> <tr> <th><span class="label-like"><?php _e('Пароль'); ?> </span></th> <td> <div class="s_passwd"> <span style="float: left;"><?php echo osc_esc_html($data['password']); ?> </span> </div> </td> </tr> </tbody> </table> </div> <p class="margin20"> <a target="_blank" href="<?php echo get_absolute_url(); ?> oc-admin/index.php" class="button"><?php _e('Закончить и перейти в панель администрирования'); ?> </a> </p> <?php }
<?php /** * 跳转到开放平台登录地址,RequestToken * @author 潘洪学 panliu888@gmail.com * @create_date 2011-10 */ include_once dirname(__FILE__) . DIRECTORY_SEPARATOR . '../init.php'; Passport::RequireLogin(); $type = $_GET['t']; $pid = intval($_GET['pid']); $api = Factory::CreateAPI($type, $pid); // 获取开放平台登录地址,跳转 switch ($api->type) { case 'kx001': $scope = 'send_feed create_records create_diary'; break; case 'renren': $scope = 'admin_page publish_blog'; break; } $cross = get_absolute_url('cross.php'); $auth_url = $api->GetAuthorizationUrl(get_absolute_url("bind.php?t={$type}&pid={$pid}&redir={$cross}", $api->callback), $scope); if (start_with($auth_url, 'http')) { redirect($auth_url); } else { echo $auth_url; }