if (substr($phpv, 0, 2) == '3.') { exit(do_lang('PHP_OLD')); } if (substr($phpv, 0, 3) == '4.0') { exit(do_lang('PHP_OLD')); } if (ini_get('file_uploads') == '0') { exit(do_lang('NO_UPLOAD')); } // Set up some globals $minor = ocp_version_minor(); $VERSION = strval(ocp_version()); if ($minor != '') { $VERSION .= (is_numeric($minor[0]) ? '.' : '-') . $minor; } $CHMOD_ARRAY = get_chmod_array(); $password_prompt = new ocp_tempcode(); if (!array_key_exists('step', $_GET)) { $_GET['step'] = '1'; } if (intval($_GET['step']) == 1) { $content = step_1(); } if (intval($_GET['step']) == 2) { $content = step_2(); } if (intval($_GET['step']) == 3) { $content = step_3(); } if (intval($_GET['step']) == 4) { $content = step_4();
/** * Do permission setting * * @return string Output messages */ function fix_perms() { require_code('inst_special'); $super_out = ''; global $LANG; $LANG = get_param('lang', 'EN'); $array = array_merge(get_chmod_array(), get_chmod_array_2()); require_code('themes2'); $themes = find_all_themes(); $GLOBALS['SUPPRESS_ERROR_DEATH'] = true; for ($i = 0; $i < count($array); $i++) { $chmod = $array[$i]; if (is_dir(get_file_base() . '/' . $chmod)) { if (strpos($chmod, 'themes/default') !== false) { foreach (array_keys($themes) as $theme) { $_chmod = str_replace('themes/default', 'themes/' . $theme, $chmod); $dh = @opendir(get_file_base() . '/' . $_chmod); if ($dh !== false) { while (($file = readdir($dh)) !== false) { if (!should_ignore_file($_chmod . '/' . $file, IGNORE_ACCESS_CONTROLLERS)) { $array[] = $_chmod . '/' . $file; } } closedir($dh); } } } else { $dh = @opendir(get_file_base() . '/' . $chmod); if ($dh !== false) { while (($file = readdir($dh)) !== false) { if (!should_ignore_file($chmod . '/' . $file, IGNORE_ACCESS_CONTROLLERS)) { $array[] = $chmod . '/' . $file; } } closedir($dh); } } } /*if (strpos($chmod,'themes/default')!==false) { foreach (array_keys($themes) as $theme) { $_chmod=str_replace('themes/default','themes/'.$theme,$chmod); if (!file_exists(get_file_base().'/'.$_chmod)) continue; if (!is_writable_wrap(get_file_base().'/'.$_chmod)) afm_set_perms($_chmod,true); } } else {*/ if (!file_exists(get_file_base() . '/' . $chmod)) { continue; } if (!is_writable_wrap(get_file_base() . '/' . $chmod)) { afm_set_perms($chmod, true); } //} } $super_out = ''; foreach ($GLOBALS['ATTACHED_MESSAGES_RAW'] as $_error) { $error = $_error[0]; if (is_object($error)) { $error = $error->evaluate(); } $super_out .= '<p>' . $error . '</p>'; } $super_out .= '<p>' . do_lang('SUCCESS') . '</p>'; $GLOBALS['SUPPRESS_ERROR_DEATH'] = false; return $super_out; }