<table width="573" height="23" border="0" cellpadding="0" cellspacing="0" style="text-align:center; font-weight:bold;font-size:12pt;background:url(views/images/install/set03_top_nav.gif); margin:10px 0 0 10px;">
  <tr>
    <td style="color:#666; text-align:center"><span style="display:block; float:left; width:20%; font-size:12px;">1. 许可协议</span><span style="display:block;float:left;width:25%;font-size:12px;">2. 环境检测</span><span style="display:block; float:left; width:25%; font-size:12px; color: #FFF;">3. 数据库设置</span><span style="display:block;float:left;width:25%;font-size:12px;">4. 安装完成</span></td>
  </tr>
</table>
<h3>安装设置:</h3>
<form  method="post" name="myform" id="gxform" style="margin:0; padding:0;">
<table width="98%" border="0" align="center" cellpadding="5" cellspacing="1" class="tableoutline" style="font-size:12px; color:#666;">
<input name="setup" type="hidden" value="<?php 
echo $_POST["setup"];
?>
">
   <tr bgcolor="#F4faff">
    <td width="48%" valign="top"><b>安装目录</b><br><font color="#666666">自动检测一般不需要修改,结尾必需加斜杆 '/'</font></td>
 <td><input type="text" name="con[web_path]" id="web_path" value="<?php 
echo get_base_path('index.php');
?>
" maxlength="50" style="width:250px;" > *</td>
  </tr>
  <tr class="firstalt">
    <td width="48%" valign="top" bgcolor="#FFFFFF"><b>服务器地址</b><br>
      <font color="#666666">一般为localhost</font></td>
    <td bgcolor="#FFFFFF"><input type="text" name="con[db_host]" id="db_host" value="localhost" maxlength="50" style="width:250px;" > *</td>
  </tr>
  <tr bgcolor="#F4faff">
    <td width="48%"><b>数据库端口</b><br><font color="#666666">请填写MYSQL数据库使用的端口</font><br></td>
    <td><input type="text" name="con[db_port]" id="db_port" value="3306" maxlength="50" style="width:250px;" > *</td>
  </tr>                   
  <tr class="firstalt">
    <td width="48%"><b>数据库用户名</b><br><font color="#666666">一般为root</font><br></td>
    <td><input type="text" name="con[db_user]" id="db_user" value="root" maxlength="50" style="width:250px;"> *</td>
/**
 * Provides a form for user consent of an OpenID relying party, where the 
 * {@link simpleid_checkid_identity()} function returns a CHECKID_APPROVAL_REQUIRED
 * or CHECKID_RETURN_TO_SUSPECT.
 *
 * Alternatively, provide a form for the user to rectify the situation where
 * {@link simpleid_checkid_identity()} function returns a CHECKID_IDENTITIES_NOT_MATCHING
 * or CHECKID_IDENTITY_NOT_EXIST
 *
 * @param array $request the original OpenID request
 * @param array $response the proposed OpenID response, subject to user
 * verification
 * @param int $reason either CHECKID_APPROVAL_REQUIRED, CHECKID_RETURN_TO_SUSPECT,
 * CHECKID_IDENTITIES_NOT_MATCHING or CHECKID_IDENTITY_NOT_EXIST
 */
function simpleid_openid_consent_form($request, $response, $reason = CHECKID_APPROVAL_REQUIRED)
{
    global $user;
    global $xtpl;
    global $version;
    $request_state = pickle($request);
    user_header($request_state);
    $realm = openid_get_realm($request, $version);
    $xtpl->assign('token', get_form_token('rp'));
    $xtpl->assign('state', pickle($response));
    $xtpl->assign('realm', htmlspecialchars($realm, ENT_QUOTES, 'UTF-8'));
    if ($response['openid.mode'] == 'cancel') {
        $xtpl->assign('switch_user_url', htmlspecialchars(simpleid_url('logout', 'destination=continue&s=' . rawurlencode($request_state), true)));
        $xtpl->assign('return_to', htmlspecialchars($request['openid.return_to'], ENT_QUOTES, 'UTF-8'));
        $xtpl->assign('identity', htmlspecialchars($request['openid.identity'], ENT_QUOTES, 'UTF-8'));
        $xtpl->parse('main.openid_consent.cancel');
    } else {
        $xtpl->assign('javascript', '<script src="' . get_base_path() . 'html/openid-consent.js" type="text/javascript"></script>');
        $rp = isset($user['rp'][$realm]) ? $user['rp'][$realm] : NULL;
        $extensions = extension_invoke_all('consent_form', $request, $response, $rp);
        $xtpl->assign('extensions', implode($extensions));
        if ($reason == CHECKID_RETURN_TO_SUSPECT) {
            $xtpl->parse('main.openid_consent.setup.suspect');
            $xtpl->assign('realm_class', 'return-to-suspect');
        }
        $xtpl->parse('main.openid_consent.setup');
    }
    $xtpl->parse('main.openid_consent');
    $xtpl->parse('main.framekiller');
    header('X-Frame-Options: DENY');
    $xtpl->assign('title', 'OpenID Login');
    $xtpl->assign('page_class', 'dialog-page');
    $xtpl->parse('main');
    $xtpl->out('main');
}
Example #3
0
 require './cms/includes/classes/Database.class.php';
 $database = new Database();
 $settings = get_settings();
 // access permission check for not registered users:
 if ($settings['check_access_permission'] == 1 && !isset($_SESSION[$settings['session_prefix'] . 'user_id'])) {
     if (is_access_denied()) {
         raise_error('403');
     }
 }
 // set timezone:
 if ($settings['time_zone']) {
     date_default_timezone_set($settings['time_zone']);
 }
 define('BASE_URL', get_base_url());
 define('STATIC_URL', BASE_URL . 'static/');
 define('BASE_PATH', get_base_path());
 require BASE_PATH . 'cms/config/definitions.conf.php';
 if ($settings['content_functions'] == 1) {
     require BASE_PATH . 'cms/includes/functions.content.inc.php';
 }
 require './cms/includes/classes/Template.class.php';
 $template = new Template();
 #$template->set_settings($settings);
 if ($settings['caching']) {
     $cache = new Cache(BASE_PATH . CACHE_DIR, $settings);
     if (!empty($_POST) || isset($_SESSION[$settings['session_prefix'] . 'user_id'])) {
         $cache->doCaching = false;
     }
 }
 if (isset($_SESSION[$settings['session_prefix'] . 'user_id'])) {
     $template->assign('admin', true);
Example #4
0
     require './includes/functions.mb_replacements.inc.php';
 }
 require './includes/classes/Database.class.php';
 $database = new Database(Database::ADMIN);
 $settings = get_settings();
 // access permission check for not registered users:
 if ($settings['check_access_permission'] == 1 && !isset($_SESSION[$settings['session_prefix'] . 'user_id'])) {
     if (is_access_denied()) {
         raise_error('403');
     }
 }
 define('ADMIN_DIR', 'cms/');
 define('CACHE_DIR', 'cms/cache/');
 define('BASE_URL', get_base_url('cms/'));
 define('STATIC_URL', BASE_URL . 'static/');
 define('BASE_PATH', get_base_path('cms/'));
 require BASE_PATH . 'cms/config/definitions.conf.php';
 if ($settings['caching']) {
     $cache = new Cache(BASE_PATH . CACHE_DIR, $settings);
     if (empty($settings['admin_auto_clear_cache'])) {
         $cache->autoClear = false;
     }
 }
 if (isset($cache) && isset($_GET['clear_cache']) && isset($_SESSION[$settings['session_prefix'] . 'user_id'])) {
     $cache->clear();
     header('Location: ' . BASE_URL);
     exit;
 }
 // set timezone:
 if ($settings['time_zone']) {
     date_default_timezone_set($settings['time_zone']);
/**
 * Entry point for SimpleID upgrade script.
 *
 * @see user_init()
 */
function upgrade_start()
{
    global $xtpl, $GETPOST;
    $xtpl = new XTemplate('html/template.xtpl');
    $xtpl->assign('version', SIMPLEID_VERSION);
    $xtpl->assign('base_path', get_base_path());
    $xtpl->assign('css', '@import url(' . get_base_path() . 'html/upgrade.css);');
    // Check if the configuration file has been defined
    if (!defined('SIMPLEID_BASE_URL')) {
        indirect_fatal_error('No configuration file found.  See the <a href="http://simpleid.koinic.net/documentation/getting-started">manual</a> for instructions on how to set up a configuration file.');
    }
    if (!is_dir(SIMPLEID_IDENTITIES_DIR)) {
        indirect_fatal_error('Identities directory not found.  See the <a href="http://simpleid.koinic.net/documentation/getting-started">manual</a> for instructions on how to set up SimpleID.');
    }
    if (!is_dir(SIMPLEID_CACHE_DIR) || !is_writeable(SIMPLEID_CACHE_DIR)) {
        indirect_fatal_error('Cache directory not found or not writeable.  See the <a href="http://simpleid.koinic.net/documentation/getting-started">manual</a> for instructions on how to set up SimpleID.');
    }
    if (!is_dir(SIMPLEID_STORE_DIR) || !is_writeable(SIMPLEID_STORE_DIR)) {
        indirect_fatal_error('Store directory not found or not writeable.  See the <a href="http://simpleid.koinic.net/documentation/getting-started">manual</a> for instructions on how to set up SimpleID.');
    }
    if (@ini_get('register_globals') === 1 || @ini_get('register_globals') === '1' || strtolower(@ini_get('register_globals')) == 'on') {
        indirect_fatal_error('register_globals is enabled in PHP configuration, which is not supported by SimpleID.  See the <a href="http://simpleid.koinic.net/documentation/getting-started/system-requirements">manual</a> for further information.');
    }
    if (!bignum_loaded()) {
        log_fatal('gmp/bcmath PHP extension not loaded.');
        indirect_fatal_error('One or more required PHP extensions (gmp/bcmath) is not loaded.  See the <a href="http://simpleid.koinic.net/documentation/getting-started/system-requirements">manual</a> for further information on system requirements.');
    }
    if (!function_exists('preg_match')) {
        log_fatal('pcre PHP extension not loaded.');
        indirect_fatal_error('One or more required PHP extensions (pcre) is not loaded.  See the <a href="http://simpleid.koinic.net/documentation/getting-started/system-requirements">manual</a> for further information on system requirements.');
    }
    if (!function_exists('session_start')) {
        log_fatal('session PHP extension not loaded.');
        indirect_fatal_error('One or more required PHP extensions (session) is not loaded.  See the <a href="http://simpleid.koinic.net/documentation/getting-started/system-requirements">manual</a> for further information on system requirements.');
    }
    if (@ini_get('suhosin.get.max_value_length') !== false && @ini_get('suhosin.get.max_value_length') < 1024) {
        log_fatal('suhosin.get.max_value_length < 1024');
        indirect_fatal_error('suhosin.get.max_value_length is less than 1024, which will lead to problems. See the <a href="http://simpleid.koinic.net/documentation/getting-started/system-requirements">manual</a> for further information on system requirements.');
    }
    $q = isset($GETPOST['q']) ? $GETPOST['q'] : '';
    $q = explode('/', $q);
    extension_init();
    user_init(NULL);
    upgrade_user_init();
    $routes = array('upgrade-selection' => 'upgrade_selection', 'upgrade-apply' => 'upgrade_apply', '.*' => 'upgrade_info');
    simpleweb_run($routes, implode('/', $q));
}