*/
define('IN_PHPBB', true);
$phpbb_root_path = defined('PHPBB_ROOT_PATH') ? PHPBB_ROOT_PATH : '../';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include $phpbb_root_path . 'common.' . $phpEx;
require $phpbb_root_path . 'ads/constants.' . $phpEx;
// Start session management
$user->session_begin();
$auth->acl($user->data);
$user->setup('mods/info_acp_ads');
// Display a login box if they are not logged in
if (!$user->data['is_registered']) {
    login_box();
}
if (!file_exists($phpbb_root_path . 'umil/umil_frontend.' . $phpEx)) {
    trigger_error('Please download the latest UMIL (Unified MOD Install Library) from: <a href="http://www.phpbb.com/mods/umil/">phpBB.com/mods/umil</a>', E_USER_ERROR);
}
include $phpbb_root_path . 'umil/umil_frontend.' . $phpEx;
$umil = new umil_frontend('ACP_ADVERTISEMENT_MANAGEMENT', true);
// Check after initiating UMIL.
if ($user->data['user_type'] != USER_FOUNDER) {
    trigger_error('FOUNDERS_ONLY');
}
if ($umil->confirm_box(true)) {
    include $phpbb_root_path . 'ads/versions.' . $phpEx;
    $umil->run_actions('uninstall', $versions, 'ads_version');
} else {
    $umil->display_stages(array('CONFIRM', 'UNINSTALL'));
    $umil->confirm_box(false, 'UNINSTALL');
}
$umil->done();
 public static function install_automod($board_dir, $make_writable)
 {
     global $quickinstall_path, $phpbb_root_path, $phpEx;
     global $qi_config, $user, $db;
     // The name of the mod to be displayed during installation.
     $mod_name = 'AUTOMOD';
     $version_config_name = 'automod_version';
     // Since AutoMOD is no longer shipped with QI we need to do some checking...
     $automod_path = '';
     if (file_exists($quickinstall_path . 'sources/automod/includes')) {
         // Let's assume they copied the contents.
         $automod_path = $quickinstall_path . 'sources/automod/';
     } else {
         if (file_exists($quickinstall_path . 'sources/automod/root/includes')) {
             // They copied to complete root to automod instead of its contents.
             $automod_path = $quickinstall_path . 'sources/automod/root/';
         } else {
             if (file_exists($quickinstall_path . 'sources/automod/upload/includes')) {
                 // They copied to complete upload directory to automod instead of its contents.
                 $automod_path = $quickinstall_path . 'sources/automod/upload/';
             } else {
                 trigger_error($user->lang['NO_AUTOMOD']);
             }
         }
     }
     file_functions::copy_dir($automod_path, $board_dir);
     // include AutoMOD lanugage files.
     if (file_exists($phpbb_root_path . 'language/' . $user->lang . '/mods/info_acp_modman.' . $phpEx)) {
         include $phpbb_root_path . 'language/' . $user->lang . '/mods/info_acp_modman.' . $phpEx;
     } else {
         include "{$phpbb_root_path}language/en/mods/info_acp_modman.{$phpEx}";
     }
     unset($GLOBALS['lang']);
     $GLOBALS['lang'] =& $user->lang;
     global $lang;
     require $phpbb_root_path . 'includes/functions_mods.' . $phpEx;
     require $phpbb_root_path . 'install/install_versions.' . $phpEx;
     require $phpbb_root_path . 'includes/functions_convert.' . $phpEx;
     require $phpbb_root_path . 'includes/functions_transfer.' . $phpEx;
     require $phpbb_root_path . 'umil/umil_frontend.' . $phpEx;
     global $current_version;
     $current_version = $qi_config['automod_version'];
     // add some language entries to prevent notices
     $user->lang += array('FILE_EDITS' => '', 'NEXT_STEP' => '');
     $umil = new umil_frontend($mod_name);
     // We will sort the actions to prevent issues from mod authors incorrectly listing the version numbers
     uksort($versions, 'version_compare');
     // Find the current version to install
     $current_version = '0.0.0';
     foreach ($versions as $version => $actions) {
         $current_version = $version;
     }
     $action = 'install';
     $version_select = $current_version;
     $umil->run_actions($action, $versions, $version_config_name, $version_select);
     if ($make_writable) {
         // Tell AutoMOD to make files world writable if that is selected
         set_config('am_file_perms', '0666');
         set_config('am_dir_perms', '0777');
     }
 }
Esempio n. 3
0
// Use the Mod's logo if one was specified
if (isset($logo_img)) {
    $template->assign_var('LOGO_IMG', $phpbb_root_path . $logo_img);
}
// Display a login box if they are not logged in
if (!$user->data['is_registered']) {
    login_box();
}
if (!class_exists('umil_frontend')) {
    if (!file_exists($phpbb_root_path . 'umil/umil_frontend.' . $phpEx)) {
        trigger_error('Please download the latest UMIL (Unified MOD Install Library) from: <a href="http://www.phpbb.com/mods/umil/">phpBB.com/mods/umil</a>', E_USER_ERROR);
    }
    include $phpbb_root_path . 'umil/umil_frontend.' . $phpEx;
}
$force_display_results = request_var('display_results', defined('DEBUG') ? true : false);
$umil = new umil_frontend($mod_name, true, $force_display_results);
// Check after initiating UMIL.
if ($user->data['user_type'] != USER_FOUNDER) {
    trigger_error('FOUNDERS_ONLY');
}
// We will sort the actions to prevent issues from mod authors incorrectly listing the version numbers
uksort($versions, 'version_compare');
// Find the current version to install
$current_version = '0.0.0';
foreach ($versions as $version => $actions) {
    $current_version = $version;
}
$template->assign_var('L_TITLE_EXPLAIN', (isset($user->lang[$mod_name . '_EXPLAIN']) ? $user->lang[$mod_name . '_EXPLAIN'] . '<br /><br />' : '') . sprintf($user->lang['VERSIONS'], $current_version, isset($config[$version_config_name]) ? $config[$version_config_name] : $user->lang['NONE']));
$submit = isset($_POST['submit']) ? true : false;
$action = request_var('action', '');
$version_select = request_var('version_select', '');
Esempio n. 4
0
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include $phpbb_root_path . 'common.' . $phpEx;
$user->session_begin();
$auth->acl($user->data);
$user->setup('mods/asacp');
$user->add_lang('mods/info_acp_asacp');
if (!$user->data['is_registered']) {
    login_box();
}
if ($user->data['user_type'] != USER_FOUNDER) {
    trigger_error('FOUNDER_ONLY');
}
if (!defined('SPAM_WORDS_TABLE')) {
    define('SPAM_WORDS_TABLE', $table_prefix . 'spam_words');
    define('SPAM_LOG_TABLE', $table_prefix . 'spam_log');
}
if (!file_exists($phpbb_root_path . 'umil/umil_frontend.' . $phpEx)) {
    trigger_error('Please download the latest UMIL (Unified MOD Install Library) from: <a href="http://www.phpbb.com/mods/umil/">phpBB.com/mods/umil</a>', E_USER_ERROR);
}
include $phpbb_root_path . 'umil/umil_frontend.' . $phpEx;
$umil = new umil_frontend('REMOVE_ASACP', true);
$stages = array('CONFIRM' => array('url' => append_sid($phpbb_root_path . 'antispam/remove_asacp.' . $phpEx)), 'UNINSTALL');
if ($umil->confirm_box(true)) {
    $umil->display_stages($stages, 2);
    include $phpbb_root_path . 'antispam/asacp_versions.' . $phpEx;
    $umil->run_actions('uninstall', $versions, 'asacp_version');
} else {
    $umil->display_stages($stages);
    $umil->confirm_box(false, 'REMOVE_ASACP');
}
$umil->done();