Exemplo n.º 1
0
function get_default_prefs()
{
    static $prefs;
    if (is_array($prefs)) {
        return $prefs;
    }
    global $cachelib;
    require_once 'lib/cache/cachelib.php';
    if ($prefs = $cachelib->getSerialized('tiki_default_preferences_cache')) {
        return $prefs;
    }
    $prefslib = TikiLib::lib('prefs');
    $prefs = $prefslib->getDefaults();
    $prefs = array_merge($prefs, array('tiki_release' => '0', 'tiki_needs_upgrade' => 'n', 'tiki_version_last_check' => 0, 'groups_are_emulated' => 'n', 'backlinks_name_len' => '0', 'feature_wiki_notepad' => 'n', 'feature_wiki_feedback_polls' => array(), 'mailin_autocheck' => 'n', 'mailin_autocheckFreq' => '0', 'mailin_autocheckLast' => 0, 'wiki_bot_bar' => 'n', 'wiki_left_column' => 'y', 'wiki_page_separator' => '...page...', 'wiki_right_column' => 'y', 'wiki_top_bar' => 'y', 'feature_wiki_watch_structure' => 'n', 'wiki_validate_plugin' => 'y', 'wiki_pagealias_tokens' => 'alias', 'webservice_consume_defaultcache' => 300, 'fgal_root_id' => 1, 'fgal_root_user_id' => 2, 'fgal_root_wiki_attachments_id' => 3, 'fgal_enable_auto_indexing' => 'y', 'fgal_asynchronous_indexing' => 'y', 'fgal_sort_mode' => '', 'fgal_list_id' => 'o', 'fgal_list_type' => 'y', 'fgal_list_name' => 'n', 'fgal_list_description' => 'o', 'fgal_list_size' => 'y', 'fgal_list_created' => 'o', 'fgal_list_lastModif' => 'y', 'fgal_list_creator' => 'o', 'fgal_list_author' => 'o', 'fgal_list_last_user' => 'o', 'fgal_list_comment' => 'o', 'fgal_list_files' => 'o', 'fgal_list_hits' => 'o', 'fgal_list_lastDownload' => 'n', 'fgal_list_lockedby' => 'a', 'fgal_list_deleteAfter' => 'n', 'fgal_list_share' => 'n', 'fgal_show_path' => 'y', 'fgal_show_explorer' => 'y', 'fgal_show_slideshow' => 'n', 'fgal_default_view' => 'list', 'fgal_list_backlinks' => 'n', 'fgal_list_id_admin' => 'y', 'fgal_list_type_admin' => 'y', 'fgal_list_name_admin' => 'n', 'fgal_list_description_admin' => 'o', 'fgal_list_size_admin' => 'y', 'fgal_list_created_admin' => 'o', 'fgal_list_lastModif_admin' => 'y', 'fgal_list_creator_admin' => 'o', 'fgal_list_author_admin' => 'o', 'fgal_list_last_user_admin' => 'o', 'fgal_list_comment_admin' => 'o', 'fgal_list_files_admin' => 'o', 'fgal_list_hits_admin' => 'o', 'fgal_list_lastDownload_admin' => 'n', 'fgal_list_lockedby_admin' => 'n', 'fgal_list_backlinks_admin' => 'y', 'fgal_show_checked' => 'y', 'feature_gal_batch' => 'n', 'feature_gal_slideshow' => 'n', 'gal_use_db' => 'y', 'gal_use_lib' => 'imagick', 'gal_match_regex' => '', 'gal_nmatch_regex' => '', 'gal_use_dir' => '', 'gal_batch_dir' => '', 'feature_gal_rankings' => 'n', 'feature_image_galleries_comments' => 'n', 'image_galleries_comments_default_order' => 'points_desc', 'image_galleries_comments_per_page' => 10, 'gal_list_name' => 'y', 'gal_list_parent' => 'n', 'gal_list_description' => 'y', 'gal_list_created' => 'n', 'gal_list_lastmodif' => 'y', 'gal_list_user' => 'n', 'gal_list_imgs' => 'y', 'gal_list_visits' => 'y', 'preset_galleries_info' => 'n', 'gal_image_mouseover' => 'n', 'cms_bot_bar' => 'y', 'cms_left_column' => 'y', 'cms_right_column' => 'y', 'cms_top_bar' => 'n', 'cms_last_viewed_month' => '0', 't_use_db' => 'y', 't_use_dir' => '', 'trackerCreatorGroupName' => ' ', 'userlevels' => function_exists('tra') ? array('1' => tra('Simple'), '2' => tra('Advanced')) : array('1' => 'Simple', '2' => 'Advanced'), 'userbreadCrumb' => 4, 'uf_use_db' => 'y', 'uf_use_dir' => '', 'userfiles_quota' => 30, 'feature_community_friends_permission' => 'n', 'feature_community_friends_permission_dep' => '2', 'lowercase_username' => 'n', 'users_prefs_country' => '', 'users_prefs_email_is_public' => 'n', 'users_prefs_homePage' => '', 'users_prefs_lat' => '0', 'users_prefs_lon' => '0', 'users_prefs_mytiki_articles' => 'y', 'users_prefs_realName' => '', 'users_prefs_gender' => '', 'users_prefs_mailCurrentAccount' => '0', 'freetags_cloud_colors' => '', 'feature_default_calendars' => 'n', 'default_calendars' => array(), 'max_rss_mapfiles' => 10, 'rss_mapfiles' => 'n', 'title_rss_mapfiles' => '', 'min_user_length' => 1, 'auth_pear' => 'tiki', 'auth_ldap_url' => '', 'auth_pear_host' => 'localhost', 'auth_pear_port' => '389', 'auth_ldap_groupnameatr' => '', 'auth_ldap_groupdescatr' => '', 'auth_ldap_syncuserattr' => 'uid', 'auth_ldap_syncgroupattr' => 'cn', 'auth_phpbb_dbport' => '', 'auth_phpbb_dbtype' => 'mysql', 'login_url' => 'tiki-login.php', 'login_scr' => 'tiki-login_scr.php', 'register_url' => 'tiki-register.php', 'error_url' => 'tiki-error.php', 'feature_intertiki_server' => 'n', 'feature_intertiki_slavemode' => 'n', 'interlist' => array(), 'feature_intertiki_mymaster' => '', 'feature_intertiki_import_preferences' => 'n', 'feature_intertiki_import_groups' => 'n', 'known_hosts' => array(), 'tiki_key' => '', 'intertiki_logfile' => '', 'intertiki_errfile' => '', 'feature_intertiki_sharedcookie' => 'n', 'category_i18n_unsynced' => array(), 'feature_sitenav' => 'n', 'sitenav' => '{tr}Navigation : {/tr}<a href="tiki-contact.php" accesskey="10" title="">{tr}Contact Us{/tr}</a>', 'feature_mods_provider' => 'n', 'mods_dir' => 'mods', 'mods_server' => 'http://mods.tiki.org', 'toolbar_global' => '
			bold,italic,underline,strike, sub, sup,-,color,-,wikiplugin_img,tikiimage,wikiplugin_file,tikifile,tikilink,link, unlink, anchor,-,
			undo, redo,-,find,replace,-, removeformat,specialchar,smiley|help,switcheditor,autosave/
			templates, cut, copy, paste, pastetext, pasteword,-,h1,h2,h3, left,center,-,
			blockquote,list,numlist,wikiplugin_mouseover,wikiplugin_module,wikiplugin_html,wikiplugin_wysiwyg,wikiplugin_draw, outdent, indent,-,
			pagebreak,rule,-,table,-,wikiplugin_code, source, showblocks,nonparsed|fullscreen/
			format,style,-,fontname,fontsize/
		', 'toolbar_global_comments' => '
			bold, italic, underline, strike , - , link, smiley | help
		', 'toolbar_sheet' => 'addrow,addrowbefore,addrowmulti,deleterow,-,addcolumn,addcolumnbefore,addcolumnmulti,deletecolumn,-,
							sheetgetrange,sheetrefresh,-,sheetfind|sheetclose,sheetsave,help/
							bold,italic,underline,strike,center,-,color,bgcolor,-,tikilink,nonparsed|fullscreen/', 'unified_forum_deepindexing' => 'y', 'unified_cached_formatters' => array('trackerrender', 'categorylist'), 'anonCanEdit' => 'n', 'feature_contribution_display_in_comment' => 'y', 'feature_contribution_mandatory' => 'n', 'feature_contribution_mandatory_blog' => 'n', 'feature_contribution_mandatory_comment' => 'n', 'feature_contribution_mandatory_forum' => 'n', 'feature_debugger_console' => 'n', 'feature_events' => 'n', 'feature_projects' => 'n', 'feature_ranking' => 'n', 'feature_top_banner' => 'n', 'feature_usability' => 'n', 'minical_reminders' => 0, 'php_docroot' => 'http://php.net/', 'shoutbox_autolink' => 'n', 'show_comzone' => 'n', 'use_proxy' => 'n', 'webserverauth' => 'n', 'feature_intertiki_imported_groups' => '', 'feature_contributor_wiki' => '', 'https_login_required' => '', 'maxRowsGalleries' => '', 'replimaster' => '', 'rowImagesGalleries' => '', 'scaleSizeGalleries' => '', 'thumbSizeXGalleries' => '', 'thumbSizeYGalleries' => '', 'javascript_enabled' => 'n', 'feature_sefurl_paths' => array(''), 'feature_bidi' => 'n', 'feature_lastup' => 'y', 'terminology_profile_installed' => 'n'));
    // Special default values
    global $tikidomain;
    if (is_file('styles/' . $tikidomain . '/' . $prefs['site_favicon'])) {
        $prefs['site_favicon'] = 'styles/' . $tikidomain . '/' . $prefs['site_favicon'];
    } elseif (!is_file($prefs['site_favicon'])) {
        $prefs['site_favicon'] = false;
    }
    $_SESSION['tmpDir'] = class_exists('TikiInit') ? TikiInit::tempdir() : '/tmp';
    $prefs['feature_bidi'] = 'n';
    $prefs['feature_lastup'] = 'y';
    // Be sure we have a default value for user prefs
    foreach ($prefs as $p => $v) {
        if (substr($p, 0, 12) == 'users_prefs_') {
            $prefs[substr($p, 12)] = $v;
        }
    }
    $cachelib->cacheItem("tiki_default_preferences_cache", serialize($prefs));
    return $prefs;
}
Exemplo n.º 2
0
function prefs_global_list($partial = false)
{
    global $tikilib, $url_host;
    $all_styles = array();
    $languages = array();
    if (!$partial) {
        $all_styles = $tikilib->list_styles();
        $languages = $tikilib->list_languages(false, null, true);
    }
    $styles = array();
    foreach ($all_styles as $style) {
        $styles[$style] = substr($style, 0, strripos($style, '.css'));
    }
    $map = array();
    foreach ($languages as $lang) {
        $map[$lang['value']] = $lang['name'];
    }
    return array('style' => array('name' => tra('Theme'), 'type' => 'list', 'help' => 'Themes', 'description' => tra('Style of the site, sometimes called a skin or CSS. See http://themes.tiki.org for more Tiki themes.'), 'options' => $styles, 'default' => 'fivealive.css', 'tags' => array('basic')), 'browsertitle' => array('name' => tra('Browser title'), 'description' => tra('Label visible in the browser\'s title bar on all pages. Also appears in search engines.'), 'type' => 'text', 'default' => '', 'tags' => array('basic')), 'validateUsers' => array('name' => tra('Validate new user registrations by email'), 'description' => tra('Upon registration, the new user will receive an email containing a link to confirm validity.'), 'type' => 'flag', 'dependencies' => array('sender_email'), 'default' => 'y', 'tags' => array('basic')), 'wikiHomePage' => array('name' => tra('Home page'), 'description' => tra('Landing page used for the wiki when no page is specified. The page will be created if it does not exist.'), 'type' => 'text', 'size' => 20, 'default' => 'HomePage', 'tags' => array('basic')), 'useGroupHome' => array('name' => tra('Use group homepages'), 'description' => tra('Users can be sent to different pages upon login, depending on their default group.'), 'type' => 'flag', 'help' => 'Groups', 'keywords' => 'group home page pages', 'default' => 'n'), 'limitedGoGroupHome' => array('name' => tra('Go to group homepage only if login from default homepage'), 'type' => 'flag', 'dependencies' => array('useGroupHome'), 'keywords' => 'group home page pages', 'default' => 'n'), 'language' => array('name' => tra('Default language'), 'description' => tra('Site language used when no other language is specified by the user.'), 'filter' => 'lang', 'help' => 'I18n', 'type' => 'list', 'options' => $map, 'default' => 'en', 'tags' => array('basic')), 'cachepages' => array('name' => tra('Cache external pages'), 'type' => 'flag', 'default' => 'n'), 'cacheimages' => array('name' => tra('Cache external images'), 'type' => 'flag', 'default' => 'n'), 'tmpDir' => array('name' => tra('Temporary directory'), 'type' => 'text', 'description' => tra('Tiki requires full read and write access to this directory.'), 'size' => 30, 'default' => TikiInit::tempdir(), 'perspective' => false, 'default' => 'temp'), 'helpurl' => array('name' => tra('Help URL'), 'description' => tra('The default help system may not be complete. You can help with the Tiki documentation.'), 'help' => 'Welcome+Authors', 'type' => 'text', 'size' => '50', 'dependencies' => array('feature_help'), 'default' => "http://doc.tiki.org/"), 'popupLinks' => array('name' => tra('Open external links in new window'), 'type' => 'flag', 'default' => 'y', 'tags' => array('basic')), 'wikiLicensePage' => array('name' => tra('License page'), 'type' => 'text', 'size' => '30', 'default' => ''), 'wikiSubmitNotice' => array('name' => tra('Submit notice'), 'type' => 'text', 'size' => '30', 'default' => ''), 'gdaltindex' => array('name' => tra('Full path to gdaltindex'), 'type' => 'text', 'size' => '50', 'help' => 'Maps', 'perspective' => false, 'default' => ''), 'ogr2ogr' => array('name' => tra('Full path to ogr2ogr'), 'type' => 'text', 'size' => '50', 'help' => 'Maps', 'perspective' => false, 'default' => ''), 'mapzone' => array('name' => tra('Map Zone'), 'type' => 'list', 'help' => 'Maps', 'options' => array('180' => '[-180 180]', '360' => '[0 360]'), 'default' => '180'), 'modallgroups' => array('name' => tra('Display modules to all groups always'), 'type' => 'flag', 'default' => 'n'), 'modseparateanon' => array('name' => tra('Hide anonymous-only modules from registered users'), 'type' => 'flag', 'default' => 'n'), 'modhideanonadmin' => array('name' => tra('Hide anonymous-only modules from Admins'), 'type' => 'flag', 'default' => 'n'), 'maxArticles' => array('name' => tra('Maximum number of articles on articles home page'), 'type' => 'text', 'size' => '5', 'filter' => 'digits', 'default' => 10), 'sitead' => array('name' => tra('Site Ads and Banners Content'), 'hint' => tra('Example:') . ' ' . "{banner zone='" . tra('Test') . "'}", 'type' => 'textarea', 'size' => '5', 'default' => ''), 'urlOnUsername' => array('name' => tra('URL to go to when clicking on a username'), 'type' => 'text', 'description' => tra('URL to go to when clicking on a username.') . ' ' . tra('Default') . ': tiki-user_information.php?userId=%userId% <em>(' . tra('Use %user% for login name and %userId% for userId)') . ')</em>', 'default' => ''), 'forgotPass' => array('name' => tra('Forgot password'), 'type' => 'flag', 'description' => tra('Users can request to reset password. They will receive a link by email.'), 'detail' => tra("Since passwords are encrypted, it's not possible to tell the user what the password is. It's only possible to change it."), 'default' => 'y', 'tags' => array('basic')), 'useGroupTheme' => array('name' => tra('Each group can have its theme'), 'type' => 'flag', 'default' => 'n'), 'sitetitle' => array('name' => tra('Site title'), 'type' => 'text', 'size' => '50', 'default' => '', 'tags' => array('basic')), 'sitesubtitle' => array('name' => tra('Subtitle'), 'type' => 'text', 'size' => '50', 'default' => '', 'tags' => array('basic')), 'maxRecords' => array('name' => tra('Maximum number of records in listings'), 'type' => 'text', 'size' => '3', 'default' => 24, 'tags' => array('basic')), 'maxVersions' => array('name' => tra('Maximum number of versions:'), 'type' => 'text', 'size' => '5', 'hint' => tra('0 for unlimited versions'), 'default' => 0), 'allowRegister' => array('name' => tra('Users can register'), 'type' => 'flag', 'default' => 'n', 'tags' => array('basic')), 'validateEmail' => array('name' => tra("Validate user's email server"), 'type' => 'flag', 'description' => tra('Tiki will perform a DNS lookup and attempt to open a SMTP session to validate the email server.'), 'default' => 'n'), 'validateRegistration' => array('name' => tra('Require validation by Admin'), 'type' => 'flag', 'description' => tra('The administrator will receive an email for each new user registration, and must validate the user before the user can login.'), 'dependencies' => array('sender_email'), 'default' => 'n'), 'useRegisterPasscode' => array('name' => tra('Require passcode to register'), 'type' => 'flag', 'description' => tra('Users must enter a code to register.  You must inform users of this code. Use to restrict registration to invited users only.'), 'default' => 'n', 'tags' => array('basic')), 'registerPasscode' => array('name' => tra('Passcode'), 'type' => 'text', 'size' => 15, 'hint' => tra('Alphanumeric code required to complete the registration'), 'default' => '', 'tags' => array('basic')), 'userTracker' => array('name' => tra('Use tracker to collect more user information'), 'type' => 'flag', 'help' => 'User+Tracker', 'description' => tra('Display a tracker (form) for the user to complete, as part of the registration process. Use this tracker to store additional information about each user.'), 'dependencies' => array('feature_trackers'), 'hint' => tra('Use the "Admin Groups" page to select which tracker and fields to display'), 'default' => 'n'), 'groupTracker' => array('name' => tra('Use tracker to collect more group information'), 'type' => 'flag', 'help' => 'Group+Tracker', 'dependencies' => array('feature_trackers'), 'hint' => tra('Use the "Admin Groups" page to select which tracker and fields to display'), 'default' => 'n'), 'eponymousGroups' => array('name' => tra('Create a new group for each user'), 'type' => 'flag', 'hint' => tra("The group will be named identical to the user's username"), 'help' => 'Groups', 'default' => 'n'), 'syncGroupsWithDirectory' => array('name' => tra('Synchronize Tiki groups with a directory'), 'type' => 'flag', 'hint' => tra('Define the directory within the "LDAP" tab'), 'default' => 'n'), 'syncUsersWithDirectory' => array('name' => tra('Synchronize Tiki users with a directory'), 'type' => 'flag', 'hint' => tra('Define the directory within the "LDAP" tab'), 'default' => 'n'), 'rememberme' => array('name' => tra('Remember me'), 'type' => 'list', 'help' => 'Login+Config#Remember_Me', 'options' => array('disabled' => tra('Disabled'), 'all' => tra("User's choice"), 'always' => tra('Always')), 'default' => 'disabled', 'tags' => array('basic')), 'remembertime' => array('name' => tra('Duration'), 'type' => 'list', 'options' => array('300' => '5 ' . tra('minutes'), '900' => '15 ' . tra('minutes'), '1800' => '30 ' . tra('minutes'), '3600' => '1 ' . tra('hour'), '7200' => '2 ' . tra('hours'), '36000' => '10 ' . tra('hours'), '72000' => '20 ' . tra('hours'), '86400' => '1 ' . tra('day'), '604800' => '1 ' . tra('week'), '2629743' => '1 ' . tra('month'), '31556926' => '1 ' . tra('year')), 'default' => 7200, 'tags' => array('basic')), 'urlIndex' => array('name' => tra('Homepage URL'), 'type' => 'text', 'size' => 50, 'default' => '', 'tags' => array('basic'), 'dependencies' => array('useUrlIndex')), 'useUrlIndex' => array('name' => tra('Use custom homepage'), 'description' => tra('Use a Tiki feature homepage or another homepage'), 'type' => 'flag', 'default' => 'n', 'tags' => array('basic')), 'tikiIndex' => array('name' => tra('Use Tiki feature as homepage'), 'type' => 'list', 'options' => feature_home_pages($partial), 'description' => tra('Select the Tiki feature to use as the site homepage. Only enabled features are listed.'), 'default' => 'tiki-index.php', 'tags' => array('basic')), 'disableJavascript' => array('name' => tra('Disable JavaScript'), 'type' => 'flag', 'description' => tra('Disable JavaScript for testing purpose even if the browser allows it'), 'default' => 'n'), 'partnerId' => array('name' => tra('Partner ID'), 'description' => tra('Kaltura Partner ID'), 'type' => 'text', 'filter' => 'digits', 'size' => 10, 'default' => ''), 'secret' => array('name' => tra('User secret'), 'description' => tra('Kaltura partner setting user secret.'), 'type' => 'text', 'size' => 45, 'filter' => 'alnum', 'default' => ''), 'adminSecret' => array('name' => tra('Admin secret'), 'description' => tra('Kaltura partner setting admin secret.'), 'type' => 'text', 'size' => 45, 'filter' => 'alnum', 'default' => ''), 'kdpUIConf' => array('name' => tra('KDP UI Configuration ID'), 'description' => tra('Kaltura Dynamic Player (KDP) user interface configuration ID'), 'type' => 'text', 'size' => 20, 'default' => '1913592'), 'kdpWidget' => array('name' => tra('KDP Widget ID'), 'description' => tra('Kaltura Dynamic Player (KDP) Widget ID. This configuration is specific to your account.'), 'hint' => tra("If you don't know better, use '_yourPartnerID'"), 'type' => 'text', 'size' => 20, 'default' => ''), 'kcwUIConf' => array('name' => tra('KCW UI Configuration ID'), 'description' => tra('Kaltura Configuration Wizard (KCW) user interface configuration ID'), 'type' => 'text', 'size' => 20, 'default' => '1913682'), 'kseUIConf' => array('name' => tra('Kaltura Simple Editor UI Configuration ID'), 'type' => 'text', 'size' => 20, 'default' => '2434291'), 'kaeUIConf' => array('name' => tra('Kaltura Advanced Editor UI Configuration ID'), 'type' => 'text', 'size' => 20, 'default' => '1000865'), 'kuser' => array('name' => tra('Kaltura "User"'), 'description' => tra('Owner of content shared by all Tiki users on this site. If empty then each Tiki user can only see their own media entries.'), 'hint' => tr("You could use your server name for this. e.g. %0", $url_host), 'type' => 'text', 'size' => 20, 'default' => $url_host), 'kServiceUrl' => array('name' => tra('Kaltura Service URL'), 'description' => tra('e.g. http://www.kaltura.com/'), 'type' => 'text', 'size' => 40, 'default' => 'http://www.kaltura.com/'));
}
Exemplo n.º 3
0
function check_session_save_path()
{
    global $errors;
    if (ini_get('session.save_handler') == 'files') {
        $save_path = ini_get('session.save_path');
        // check if we can check it. The session.save_path can be outside
        // the open_basedir paths.
        $open_basedir = ini_get('open_basedir');
        if (empty($open_basedir)) {
            if (!is_dir($save_path)) {
                $errors .= "The directory '{$save_path}' does not exist or PHP is not allowed to access it (check open_basedir entry in php.ini).\n";
            } else {
                if (!TikiInit::is_writeable($save_path)) {
                    $errors .= "The directory '{$save_path}' is not writeable.\n";
                }
            }
        }
        if ($errors) {
            $save_path = TikiInit::tempdir();
            if (is_dir($save_path) && TikiInit::is_writeable($save_path)) {
                ini_set('session.save_path', $save_path);
                $errors = '';
            }
        }
    }
}
Exemplo n.º 4
0
 $prefs['javascript_enabled'] = 'n';
 $prefs['feature_comments_post_as_anonymous'] = 'n';
 $prefs['feature_template_zoom'] = 'y';
 # TikiTests
 $prefs['feature_tikitests'] = 'n';
 # Tiki Profiles
 $prefs['profile_sources'] = 'http://profiles.tikiwiki.org/profiles';
 # Minichat
 $prefs['feature_minichat'] = 'n';
 // Special default values
 if (is_file('styles/' . $tikidomain . '/' . $prefs['site_favicon'])) {
     $prefs['site_favicon'] = 'styles/' . $tikidomain . '/' . $prefs['site_favicon'];
 } elseif (!is_file($prefs['site_favicon'])) {
     $prefs['site_favicon'] = false;
 }
 $_SESSION['tmpDir'] = TikiInit::tempdir();
 //??
 $prefs['feature_bidi'] = 'n';
 $prefs['feature_lastup'] = 'y';
 $prefs['transition_style_ver'] = '1.9';
 // Find which preferences need to be serialized/unserialized, based on the default values (those with arrays as values)
 if (!isset($_SESSION['serialized_prefs'])) {
     $_SESSION['serialized_prefs'] = array();
     foreach ($prefs as $p => $v) {
         if (is_array($v)) {
             $_SESSION['serialized_prefs'][] = $p;
         }
     }
 }
 // Be sure we have a default value for user prefs
 foreach ($prefs as $p => $v) {
Exemplo n.º 5
0
function prefs_global_list($partial = false)
{
    return array('browsertitle' => array('name' => tra('Browser title'), 'description' => tra('Label visible in the browser\'s title bar on all pages. Also appears in search engines.'), 'type' => 'text', 'default' => '', 'tags' => array('basic'), 'public' => true), 'validateUsers' => array('name' => tra('Validate new user registrations by email'), 'description' => tra('Upon registration, the new user will receive an email containing a link to confirm validity.'), 'type' => 'flag', 'dependencies' => array('sender_email'), 'default' => 'y', 'tags' => array('basic')), 'wikiHomePage' => array('name' => tra('Wiki Home page'), 'description' => tra('Landing page used for the wiki when no page is specified. The page will be created if it does not exist.'), 'keywords' => 'homepage', 'type' => 'text', 'size' => 20, 'default' => 'HomePage', 'tags' => array('basic'), 'profile_reference' => 'wiki_page'), 'useGroupHome' => array('name' => tra('Use group homepages'), 'description' => tra('Users can be sent to different pages upon login, depending on their default group.'), 'type' => 'flag', 'help' => 'Groups', 'keywords' => 'group home page pages', 'default' => 'n'), 'limitedGoGroupHome' => array('name' => tra('Go to group homepage only if login from default homepage'), 'description' => tra(''), 'type' => 'flag', 'dependencies' => array('useGroupHome'), 'keywords' => 'group home page pages', 'default' => 'n'), 'cachepages' => array('name' => tra('Cache external pages'), 'description' => tra(''), 'type' => 'flag', 'default' => 'n'), 'cacheimages' => array('name' => tra('Cache external images'), 'description' => tra(''), 'type' => 'flag', 'default' => 'n'), 'tmpDir' => array('name' => tra('Temporary directory'), 'description' => tra('Tiki requires full read and write access to this directory.'), 'type' => 'text', 'size' => 30, 'default' => TikiInit::tempdir(), 'perspective' => false, 'default' => 'temp'), 'helpurl' => array('name' => tra('Help URL'), 'description' => tra('The default help system may not be complete. You can help with the Tiki documentation.'), 'help' => 'Welcome+Authors', 'type' => 'text', 'size' => '50', 'dependencies' => array('feature_help'), 'default' => "http://doc.tiki.org/", 'public' => true), 'popupLinks' => array('name' => tra('Open external links in new window'), 'description' => tra(''), 'type' => 'flag', 'default' => 'y', 'tags' => array('basic')), 'wikiLicensePage' => array('name' => tra('License page'), 'description' => tra(''), 'type' => 'text', 'size' => '30', 'default' => ''), 'wikiSubmitNotice' => array('name' => tra('Submit notice'), 'description' => tra(''), 'type' => 'text', 'size' => '30', 'default' => ''), 'gdaltindex' => array('name' => tra('Full path to gdaltindex'), 'description' => tra(''), 'type' => 'text', 'size' => '50', 'help' => 'Maps', 'perspective' => false, 'default' => ''), 'ogr2ogr' => array('name' => tra('Full path to ogr2ogr'), 'description' => tra(''), 'type' => 'text', 'size' => '50', 'help' => 'Maps', 'perspective' => false, 'default' => ''), 'mapzone' => array('name' => tra('Map Zone'), 'description' => tra(''), 'type' => 'list', 'help' => 'Maps', 'options' => array('180' => '[-180 180]', '360' => '[0 360]'), 'default' => '180'), 'modallgroups' => array('name' => tra('Display modules to all groups always'), 'description' => tra(''), 'type' => 'flag', 'default' => 'n'), 'modseparateanon' => array('name' => tra('Hide anonymous-only modules from registered users'), 'description' => tra(''), 'type' => 'flag', 'default' => 'n'), 'modhideanonadmin' => array('name' => tra('Hide anonymous-only modules from Admins'), 'type' => 'flag', 'default' => 'n'), 'maxArticles' => array('name' => tra('Maximum number of articles on articles home page'), 'description' => tra(''), 'type' => 'text', 'size' => '5', 'filter' => 'digits', 'default' => 10), 'sitead' => array('name' => tra('Site Ads and Banners Content'), 'description' => tra(''), 'hint' => tra('Example:') . ' ' . "{banner zone='" . tra('Test') . "'}", 'type' => 'textarea', 'size' => '5', 'default' => ''), 'urlOnUsername' => array('name' => tra('URL to go to when clicking on a username'), 'description' => tra(''), 'type' => 'text', 'description' => tra('URL to go to when clicking on a username.') . ' ' . tra('Default') . ': tiki-user_information.php?userId=%userId% <em>(' . tra('Use %user% for login name and %userId% for userId)') . ')</em>', 'default' => ''), 'forgotPass' => array('name' => tra('Forgot password'), 'description' => tra('Users can request to reset password. They will receive a link by email.'), 'type' => 'flag', 'detail' => tra("Since passwords are encrypted, it's not possible to tell the user what the password is. It's only possible to change it."), 'default' => 'y', 'tags' => array('basic')), 'useGroupTheme' => array('name' => tra('Group Theme'), 'description' => tra('Each group can have its theme'), 'type' => 'flag', 'default' => 'n'), 'sitetitle' => array('name' => tra('Site title'), 'description' => tra(''), 'type' => 'text', 'size' => '50', 'default' => '', 'tags' => array('basic'), 'public' => true), 'sitesubtitle' => array('name' => tra('Subtitle'), 'description' => tra(''), 'type' => 'text', 'size' => '50', 'default' => '', 'tags' => array('basic'), 'public' => true), 'maxRecords' => array('name' => tra('Maximum number of records in listings'), 'description' => tra(''), 'type' => 'text', 'size' => '3', 'default' => 25, 'tags' => array('basic'), 'public' => true), 'maxVersions' => array('name' => tra('Maximum number of versions:'), 'description' => tra(''), 'type' => 'text', 'size' => '5', 'hint' => tra('0 for unlimited versions'), 'default' => 0), 'allowRegister' => array('name' => tra('Users can register'), 'description' => tra('permit User registration'), 'type' => 'flag', 'default' => 'n', 'tags' => array('basic')), 'validateEmail' => array('name' => tra("Validate user's email server"), 'description' => tra('Tiki will perform a DNS lookup and attempt to open a SMTP session to validate the email server.'), 'type' => 'flag', 'default' => 'n'), 'validateRegistration' => array('name' => tra('Require validation by Admin'), 'description' => tra('The administrator will receive an email for each new user registration, and must validate the user before the user can login.'), 'type' => 'flag', 'dependencies' => array('sender_email'), 'default' => 'n'), 'useRegisterPasscode' => array('name' => tra('Require passcode to register'), 'description' => tra('Users must enter a code to register.  You must inform users of this code. Use to restrict registration to invited users only.'), 'type' => 'flag', 'default' => 'n', 'tags' => array('basic')), 'registerPasscode' => array('name' => tra('Passcode'), 'description' => tra(''), 'type' => 'text', 'size' => 15, 'hint' => tra('Alphanumeric code required to complete the registration'), 'default' => '', 'tags' => array('basic')), 'showRegisterPasscode' => array('name' => tra('Show passcode on registration form'), 'description' => tra("Displays the required passcode on the registration form. This is helpful for legitimate users who want to register while making it difficult for automated robots because the passcode is unique for each site and because it is displayed in JavaScript."), 'type' => 'flag', 'default' => 'n', 'tags' => array('basic')), 'registerKey' => array('name' => tra('Registration Page Key'), 'hint' => tra('Key required to be on included the URL to access the registration page (if not empty).'), 'description' => tra('e.g. To register users need to go to: tiki-register.php?key=yourregistrationkeyvalue'), 'type' => 'text', 'size' => 15, 'default' => '', 'tags' => array('basic')), 'userTracker' => array('name' => tra('Use tracker to collect more user information'), 'description' => tra('Display a tracker (form) for the user to complete, as part of the registration process. Use this tracker to store additional information about each user.'), 'type' => 'flag', 'help' => 'User+Tracker', 'dependencies' => array('feature_trackers'), 'hint' => tra('Use the "Admin Groups" page to select which tracker and fields to display'), 'default' => 'n'), 'groupTracker' => array('name' => tra('Use tracker to collect more group information'), 'description' => tra(''), 'type' => 'flag', 'help' => 'Group+Tracker', 'dependencies' => array('feature_trackers'), 'hint' => tra('Use the "Admin Groups" page to select which tracker and fields to display'), 'default' => 'n'), 'eponymousGroups' => array('name' => tra('Create a new group for each user'), 'description' => tra(''), 'type' => 'flag', 'hint' => tra("The group will be named identical to the user's username"), 'help' => 'Groups', 'default' => 'n', 'keywords' => 'eponymous groups'), 'syncGroupsWithDirectory' => array('name' => tra('Synchronize Tiki groups with a directory'), 'description' => tra(''), 'type' => 'flag', 'hint' => tra('Define the directory within the "LDAP" tab'), 'default' => 'n'), 'syncUsersWithDirectory' => array('name' => tra('Synchronize Tiki users with a directory'), 'description' => tra(''), 'type' => 'flag', 'hint' => tra('Define the directory within the "LDAP" tab'), 'default' => 'n'), 'rememberme' => array('name' => tra('Remember me'), 'description' => tra(''), 'type' => 'list', 'help' => 'Login+Config#Remember_Me', 'options' => array('disabled' => tra('Disabled'), 'all' => tra("User's choice"), 'always' => tra('Always')), 'default' => 'disabled', 'tags' => array('basic')), 'remembertime' => array('name' => tra('Duration'), 'description' => tra(''), 'type' => 'list', 'options' => array('300' => '5 ' . tra('minutes'), '900' => '15 ' . tra('minutes'), '1800' => '30 ' . tra('minutes'), '3600' => '1 ' . tra('hour'), '7200' => '2 ' . tra('hours'), '36000' => '10 ' . tra('hours'), '72000' => '20 ' . tra('hours'), '86400' => '1 ' . tra('day'), '604800' => '1 ' . tra('week'), '2629743' => '1 ' . tra('month'), '31556926' => '1 ' . tra('year')), 'default' => 7200, 'tags' => array('basic')), 'urlIndex' => array('name' => tra('Homepage URL'), 'description' => tra(''), 'type' => 'text', 'size' => 50, 'default' => '', 'tags' => array('basic'), 'dependencies' => array('useUrlIndex')), 'useUrlIndex' => array('name' => tra('Use custom homepage'), 'description' => tra('Use a Tiki feature homepage or another homepage'), 'type' => 'flag', 'default' => 'n', 'tags' => array('basic')), 'tikiIndex' => array('name' => tra('Use Tiki feature as homepage'), 'description' => tra('Select the Tiki feature to use as the site homepage. Only enabled features are listed.'), 'type' => 'list', 'options' => feature_home_pages($partial), 'default' => 'tiki-index.php', 'tags' => array('basic')), 'disableJavascript' => array('name' => tra('Disable JavaScript'), 'description' => tra('Disable JavaScript for testing purpose even if the browser allows it'), 'type' => 'flag', 'default' => 'n'));
}
Exemplo n.º 6
0
            }
            ob_end_clean();
            print "\n<html><body>\n<h2><font color='red'>TikiWiki is not properly set up:</font></h1>\n<pre>\n{$errors}\n";
            if ($tikidomain) {
                $install_link = '?multi=' . urlencode($tikidomain);
            }
            if (!TikiSetup::isWindows()) {
                print "You may either chmod the directories above manually to 777, or run one of the sets of commands below.\n<b><a href='tiki-install.php{$install_link}'>Proceed to the Tiki installer</a></b> after you run the commands below.\n\nIf you cannot become root, and are NOT part of the group {$wwwgroup}:\n    \$ bash\n    \$ cd {$docroot}\n    \$ chmod +x setup.sh\n    \$ ./setup.sh yourlogin yourgroup 02777\n    Tip: You can find your group using the command 'id'.\n\nIf you cannot become root, but are a member of the group {$wwwgroup}:\n    \$ bash\n    \$ cd {$docroot}\n    \$ chmod +x setup.sh\n    \$ ./setup.sh mylogin {$wwwgroup}</i>\n\nIf you can become root:\n    \$ bash\n    \$ cd {$docroot}\n    \$ chmod +x setup.sh\n    \$ su -c './setup.sh {$wwwuser}'\n\nIf you have problems accessing a directory, check the open_basedir entry in\n{$PHP_CONFIG_FILE_PATH}/php.ini or {$httpd_conf}.\n\nOnce you have executed these commands, this message will disappear!\n\nNote: If you cannot become root, you will not be able to delete certain\nfiles created by apache, and will need to ask your system administrator\nto delete them for you if needed.\n\n<a href='http://tikiwiki.org/InstallTiki' target='_blank'>Consult the tikiwiki.org installation guide</a> if you need more help.\n\n<b><a href='tiki-install.php'>Proceed to the Tiki installer</a></b> if you've completed the steps above.\n</pre></body></html>";
            }
            exit;
        }
    }
}
TikiSetup::prependIncludePath('lib');
TikiSetup::prependIncludePath('lib/pear');
$tmpDir = TikiInit::tempdir();
class timer
{
    function parseMicro($micro)
    {
        list($micro, $sec) = explode(' ', microtime());
        return $sec + $micro;
    }
    function start($timer = 'default', $restart = FALSE)
    {
        if (isset($this->timer[$timer]) && !$restart) {
            // report error - timer already exists
        }
        $this->timer[$timer] = $this->parseMicro(microtime());
    }
    function stop($timer = 'default')