Beispiel #1
0
 public static function fromDb(array $acc)
 {
     $account = new self();
     $account->source = self::getSource($acc);
     $wikiParams = ['namespace' => $acc['namespace'], 'structure_routing' => $acc['routing'] == 'y'];
     try {
         $container = \TikiInit::getContainer();
         $type = str_replace('-', '', $acc['type']);
         $provider = $container->get("tiki.mailin.provider.{$type}");
         $account->actionFactory = $provider->getActionFactory($acc);
     } catch (ServiceNotFoundException $e) {
         throw new Exception\MailInException("Action factory not found.");
     }
     $account->accountAddress = $acc['account'];
     $account->anonymousAllowed = $acc['anonymous'] == 'y';
     $account->adminAllowed = $acc['admin'] == 'y';
     $account->sendResponses = $acc['respond_email'] == 'y';
     $account->discardAfter = $acc['discard_after'];
     $account->defaultCategory = $acc['categoryId'];
     $account->saveHtml = $acc['save_html'] == 'y';
     $account->deleteOnError = $acc['leave_email'] != 'y';
     $account->auto_attachments = $acc['attachments'] == 'y';
     $account->inline_attachments = $acc['show_inlineImages'] == 'y';
     return $account;
 }
Beispiel #2
0
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $path = $input->getArgument('path');
     if (substr($path, -1) == '/') {
         $path = substr($path, 0, strlen($path) - 1);
     }
     if (!is_dir($path)) {
         $output->writeln('<error>Error: Provided path not found</error>');
         return;
     }
     $local = \TikiInit::getCredentialsFile();
     if (!is_readable($local)) {
         $output->writeln('<error>Error: "' . $local . '" not readable.</error>');
         return;
     }
     require $local;
     $args = array();
     if ($user_tiki) {
         $args[] = "-u" . escapeshellarg($user_tiki);
     }
     if ($pass_tiki) {
         $args[] = "-p" . escapeshellarg($pass_tiki);
     }
     if ($host_tiki) {
         $args[] = "-h" . escapeshellarg($host_tiki);
     }
     $args[] = $dbs_tiki;
     $args = implode(' ', $args);
     $outputFile = $path . '/' . $dbs_tiki . '_' . date('Y-m-d_H:i:s') . '.sql.gz';
     $command = "mysqldump --quick {$args} | gzip -5 > " . escapeshellarg($outputFile);
     exec($command);
     $output->writeln('<comment>Database backup completed: ' . $outputFile . '</comment>');
 }
Beispiel #3
0
 function list_available_types()
 {
     $container = TikiInit::getContainer();
     $list = $container->get('tiki.mailin.providerlist');
     $out = [];
     foreach ($list->getList() as $provider) {
         $out[$provider->getType()] = ['name' => $provider->getLabel(), 'enabled' => $provider->isEnabled()];
     }
     return $out;
 }
Beispiel #4
0
 /** Append $path to the include path
  * \static
  */
 function appendIncludePath($path)
 {
     $include_path = ini_get('include_path');
     if ($include_path) {
         $include_path .= TikiInit::pathSeparator() . $path;
     } else {
         $include_path = $path;
     }
     return ini_set('include_path', $include_path);
 }
/**
 * @param $installer
 */
function upgrade_20120429_fix_collation_tiki($installer)
{
    global $dbs_tiki;
    require TikiInit::getCredentialsFile();
    $installer->query("ALTER DATABASE `" . $dbs_tiki . "` CHARACTER SET 'utf8' COLLATE 'utf8_unicode_ci'");
    unset($dbs_tiki);
    $results = $installer->fetchAll('SHOW TABLES');
    foreach ($results as $table) {
        $installer->query('ALTER TABLE ' . reset($table) . ' convert to character set DEFAULT COLLATE DEFAULT');
    }
}
Beispiel #6
0
 function initSeed($phraseMD5)
 {
     if (extension_loaded('mcrypt') && $this->mcrypt == null) {
         $this->key = $phraseMD5;
         // Using Rijndael 256 in CBC mode.
         $this->mcrypt = mcrypt_module_open(MCRYPT_RIJNDAEL_256, '', 'cbc', '');
         if (TikiInit::isWindows()) {
             $this->iv = mcrypt_create_iv(mcrypt_enc_get_iv_size($this->mcrypt), MCRYPT_RAND);
         } else {
             $this->iv = mcrypt_create_iv(mcrypt_enc_get_iv_size($this->mcrypt), MCRYPT_DEV_RANDOM);
         }
     }
 }
Beispiel #7
0
 function lib($name)
 {
     if (isset($this->libraries[$name])) {
         return $this->libraries[$name];
     }
     $container = TikiInit::getContainer();
     $service = 'tikiaddon.' . $this->getVendor() . '.' . $this->getShortName() . '.' . $name;
     if ($lib = $container->get($service, \Symfony\Component\DependencyInjection\ContainerInterface::NULL_ON_INVALID_REFERENCE)) {
         return $lib;
     }
     unlink(TIKI_PATH . '/temp/cache/container.php');
     // Remove the container cache to help transition
     throw new Exception(tr("%0 library not found. This may be due to a typo or caused by a recent update.", $name));
 }
 /** Append $path to the include path
  * \static
  */
 function appendIncludePath($path)
 {
     $include_path = ini_get('include_path');
     if ($include_path) {
         $include_path .= TikiInit::pathSeparator() . $path;
     } else {
         $include_path = $path;
     }
     if (phpversion() >= '4.3') {
         return set_include_path($include_path);
     } else {
         return ini_set('include_path', $include_path);
     }
 }
Beispiel #9
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;
}
Beispiel #10
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/'));
}
Beispiel #11
0
    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $username = $input->getArgument('username');
        $password = $input->getArgument('password');
        $database = $input->getArgument('database');
        if (!($hostname = $input->getOption('host', 'localhost'))) {
            $hostname = 'localhost';
        }
        $twversion = new \TWVersion();
        $version = $twversion->getBaseVersion();
        $export_username = var_export($username, true);
        $export_password = var_export($password, true);
        $export_database = var_export($database, true);
        $export_hostname = var_export($hostname, true);
        $export_version = var_export($version, true);
        $out = <<<LOCALPHP
<?php
\$db_tiki='mysql';
\$dbversion_tiki={$export_version};
\$host_tiki={$export_hostname};
\$user_tiki={$export_username};
\$pass_tiki={$export_password};
\$dbs_tiki={$export_database};
\$client_charset='utf8';
// If you experience text encoding issues after updating (e.g. apostrophes etc showing up as strange characters)
// \$client_charset='latin1';
// \$client_charset='utf8';
// See http://tiki.org/ReleaseNotes5.0#Known_Issues and http://doc.tiki.org/Understanding+Encoding for more info

// If your php installation does not not have pdo extension
// \$api_tiki = 'adodb';

// Want configurations managed at the system level or restrict some preferences? http://doc.tiki.org/System+Configuration
// \$system_configuration_file = '/etc/tiki.ini';
// \$system_configuration_identifier = 'example.com';

LOCALPHP;
        $local_php = \TikiInit::getCredentialsFile();
        file_put_contents($local_php, $out);
        $output->writeln("Wrote {$local_php}");
    }
Beispiel #12
0
 function getBroker($addonpackage = '')
 {
     if ($addonpackage) {
         $utilities = new TikiAddons_Utilities();
         if (!$utilities->isInstalled(str_replace('.', '/', $addonpackage))) {
             $addonpackage = '';
         }
     }
     if ($addonpackage && !isset($this->addonbrokers[$addonpackage])) {
         $this->addonbrokers[$addonpackage] = new Services_Broker(TikiInit::getContainer(), $addonpackage);
     } else {
         if (!$this->broker) {
             $this->broker = new Services_Broker(TikiInit::getContainer());
         }
     }
     if ($addonpackage) {
         return $this->addonbrokers[$addonpackage];
     } else {
         return $this->broker;
     }
 }
Beispiel #13
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'));
}
Beispiel #14
0
    $language = $prefs['site_language'] = $prefs['language'] = $_REQUEST['lang'];
} else {
    $language = $prefs['site_language'] = $prefs['language'] = 'en';
}
include_once 'lib/init/tra.php';
$local_php = TikiInit::getCredentialsFile();
global $default_api_tiki, $api_tiki, $db_tiki, $dbversion_tiki, $host_tiki, $user_tiki, $pass_tiki, $dbs_tiki, $tikidomain, $tikidomainslash;
$re = false;
if (file_exists($local_php)) {
    $re = (include $local_php);
}
if (!isset($client_charset)) {
    $client_charset = 'utf8';
}
$credentials = array('api_tiki' => empty($api_tiki) ? $default_api_tiki : $api_tiki, 'api_tiki_forced' => !empty($api_tiki), 'primary' => false, 'shadow' => false);
if ($parts = TikiInit::getEnvironmentCredentials()) {
    $credentials['primary'] = $parts;
    $re = true;
} else {
    if (isset($shadow_host, $shadow_user, $shadow_pass, $shadow_dbs)) {
        $credentials['shadow'] = array('host' => $shadow_host, 'user' => $shadow_user, 'pass' => $shadow_pass, 'dbs' => $shadow_dbs, 'charset' => $client_charset, 'socket' => isset($socket_tiki) ? $socket_tiki : null);
    }
    if (isset($host_tiki, $user_tiki, $pass_tiki, $dbs_tiki)) {
        $credentials['primary'] = array('host' => $host_tiki, 'user' => $user_tiki, 'pass' => $pass_tiki, 'dbs' => $dbs_tiki, 'charset' => $client_charset, 'socket' => null);
    }
}
unset($host_map, $db_tiki, $host_tiki, $user_tiki, $pass_tiki, $dbs_tiki, $shadow_user, $shadow_pass, $shadow_host, $shadow_dbs);
global $systemConfiguration;
$systemConfiguration = new Zend_Config(array('preference' => array('feature_jison_wiki_parser' => 'n'), 'rules' => array()), array('readOnly' => false));
if (isset($_SERVER['TIKI_INI_FILE'])) {
    if (!is_readable($_SERVER['TIKI_INI_FILE'])) {
Beispiel #15
0
 /**
  * @param $string
  * @return string UTF-8
  */
 public static function rawurldecode($string)
 {
     return TikiInit::to_utf8(rawurldecode($string));
 }
Beispiel #16
0
 /**
  * @param $patch
  */
 function installPatch($patch)
 {
     if (!in_array($patch, $this->patches)) {
         return;
     }
     $schema = dirname(__FILE__) . "/schema/{$patch}.sql";
     $script = dirname(__FILE__) . "/schema/{$patch}.php";
     $profile = dirname(__FILE__) . "/schema/{$patch}.yml";
     $pre = "pre_{$patch}";
     $post = "post_{$patch}";
     $standalone = "upgrade_{$patch}";
     if (file_exists($script)) {
         require $script;
     }
     global $dbs_tiki;
     $local_php = TikiInit::getCredentialsFile();
     if (empty($dbs_tiki) && is_readable($local_php)) {
         require $local_php;
         unset($db_tiki, $host_tiki, $user_tiki, $pass_tiki);
     }
     if (function_exists($standalone)) {
         $standalone($this);
     } else {
         if (function_exists($pre)) {
             $pre($this);
         }
         if (file_exists($profile)) {
             $status = $this->applyProfile($profile);
         } else {
             $status = $this->runFile($schema);
         }
         if (function_exists($post)) {
             $post($this);
         }
     }
     if (!isset($status) || $status) {
         $this->installed[] = $patch;
         $this->recordPatch($patch);
     }
 }
Beispiel #17
0
// (c) Copyright 2002-2013 by authors of the Tiki Wiki CMS Groupware Project
//
// All Rights Reserved. See copyright.txt for details and a complete list of authors.
// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
// $Id: include_sefurl.php 50503 2014-03-25 23:52:33Z jyhem $
require_once 'tiki-setup.php';
$access->check_script($_SERVER["SCRIPT_NAME"], basename(__FILE__));
if (isset($_REQUEST['save'])) {
    check_ticket('admin-inc-sefurl');
    $_REQUEST['feature_sefurl_paths'] = preg_split('/ *[,\\/] */', $_REQUEST['feature_sefurl_paths']);
    simple_set_value('feature_sefurl_paths');
}
if (TikiInit::isIIS()) {
    $httpd = 'IIS';
    if (TikiInit::hasIIS_UrlRewriteModule()) {
        $smarty->assign('IIS_UrlRewriteModule', true);
        $enabledFileName = 'web.config';
        $referenceFileName = 'web_config';
    } else {
        $smarty->assign('IIS_UrlRewriteModule', false);
    }
} else {
    $enabledFileName = '.htaccess';
    $referenceFileName = '_htaccess';
    $httpd = 'Apache';
}
$smarty->assign('httpd', $httpd);
// Check if the URL rewriting configuration file is present and current
$configurationFile = "missing";
if (isset($enabledFileName)) {
Beispiel #18
0
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $tikilib = \TikiLib::lib('tiki');
     $path = $input->getArgument('path');
     if (substr($path, -1) == '/') {
         $path = substr($path, 0, strlen($path) - 1);
     }
     if (!is_dir($path)) {
         $output->writeln('<error>Error: Provided path not found</error>');
         return;
     }
     $local = \TikiInit::getCredentialsFile();
     if (!is_readable($local)) {
         $output->writeln('<error>Error: "' . $local . '" not readable.</error>');
         return;
     }
     require $local;
     $root = getcwd();
     if (!$root) {
         $output->writeln('<error>Error: Unable to derive source path</error>');
         return;
     }
     if ($input->getOption('storageonly')) {
         $source = '';
     } else {
         $source = escapeshellarg($root);
     }
     // get other directories
     if (!$input->getOption('nostorage')) {
         $query = "select distinct value from tiki_preferences where name like '%use_dir' union select att_store_dir from tiki_forums";
         $result = $tikilib->query($query);
         $storage = array();
         while ($res = $result->fetchRow()) {
             $storage[] = $res['value'];
         }
         foreach ($storage as $dir) {
             if (strpos($dir, '..') !== FALSE) {
                 $output->writeln('<error>Warning: Unable to backup storage directory ' . $dir . ' (please use absolute path)</error>');
                 continue;
             }
             if (!empty($dir) && $input->getOption('storageonly') && substr($dir, 0, 1) != '/') {
                 $dir = $root . '/' . $dir;
             } elseif (!$dir || substr($dir, 0, 1) != '/') {
                 continue;
             }
             if (substr($dir, -1) == '/') {
                 $dir = substr($dir, 0, strlen($dir) - 1);
             }
             if (!is_dir($dir)) {
                 $output->writeln('<error>Warning: Unable to backup storage directory ' . $dir . ' (directory not found)</error>');
                 continue;
             }
             $source .= ' ' . escapeshellarg($dir);
         }
     }
     if (!$source) {
         $output->writeln('<error>Error: No backup sources found.</error>');
         return;
     }
     $tarLocation = $path . '/' . $dbs_tiki . '_' . date('Y-m-d_H:i:s') . '.tar.bz2';
     $tar = escapeshellarg($tarLocation);
     $command = "tar -cjf {$tar} {$source}";
     exec($command);
     $output->writeln('<comment>Backup complete: ' . $tarLocation . '</comment>');
 }
<?php

/**
 * @package tikiwiki
 */
// (c) Copyright 2002-2015 by authors of the Tiki Wiki CMS Groupware Project
//
// All Rights Reserved. See copyright.txt for details and a complete list of authors.
// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
// $Id$
require_once 'tiki-setup.php';
$access->check_feature('feature_calendar');
$access->check_permission('tiki_p_view_events');
// Initialization
TikiInit::appendIncludePath("lib/ical/");
include_once 'lib/ical/iCal.php';
// list calendars //
$calendarlib = TikiLib::lib('calendar');
// ###trebly:B10111:[FIX-ADD-ENH]->  there are several meaning for the same var $calendarViewMode
if (!isset($calendarViewMode)) {
    // ###trebly:B10111:[FIX-ADD-ENH]-> $calendarViewMode become an array, several bugs comes from confusion of global values and parameters by ref
    // for calendars : (main-)calendar, action_calendar, mod_calendar, mod_action_calendar the changes of values by url request is terrible
    // for the moment 01/11/2011:11:55 just one value is used with index 'default', but initialisation is done.
    // The init is actually into two places, tiki-calendar_setup.php and tiki-calendar_export.php will be grouped for clean
    // $prefs would be added when need, $_SESSION, $PARAMS too this now generates not any change in the behavior.
    $calendarViewMode = array(casedefault => 'month', calgen => 'month', calaction => 'month', modcalgen => 'month', modcalaction => 'month', trackercal => 'month');
    if (!empty($_REQUEST['viewmode'])) {
        $calendarViewMode['casedefault'] = $_REQUEST['viewmode'];
    } elseif (!empty($_SESSION['CalendarViewMode'])) {
        $calendarViewMode['casedefault'] = $_SESSION['CalendarViewMode'];
    } else {
 private function getEngineSet($set)
 {
     $container = TikiInit::getContainer();
     return $container->get("tiki.recommendation.{$set}.set");
 }
Beispiel #21
0
        break;
}
// Global check
if (is_null($base) || is_null($path)) {
    header('HTTP/1.0 500 Internal Server Error');
    header('Content-Type: text/plain; charset=utf-8');
    echo "Request could not be understood. Verify routing file.";
    exit;
}
tiki_route($path);
if ($inclusion) {
    $_SERVER['PHP_SELF'] = $inclusion;
    include __DIR__ . '/' . $inclusion;
} else {
    error_log("No route found - full:{$full} query:{$_SERVER['QUERY_STRING']}");
    // Route to the "no-route" URL, if found
    require_once 'lib/init/initlib.php';
    $local_php = TikiInit::getCredentialsFile();
    if (file_exists($local_php)) {
        include $local_php;
    }
    if (empty($noroute_url)) {
        // Fail
        header('HTTP/1.0 404 Not Found');
        header('Content-Type: text/plain; charset=utf-8');
        echo "No route found. Please see http://dev.tiki.org/URL+Rewriting+Revamp";
    } else {
        header('Location: ' . $noroute_url);
    }
    exit;
}
Beispiel #22
0
if (empty($fileId)) {
    if ($gal_info['type'] == 'user') {
        $galleries = $filegallib->getSubGalleries($requestGalleryId, true, 'userfiles');
    } else {
        $galleries = $filegallib->getSubGalleries($requestGalleryId, true, 'upload_files');
    }
    $smarty->assign_by_ref('galleries', $galleries["data"]);
    $smarty->assign('treeRootId', $galleries['parentId']);
}
if ($prefs['fgal_limit_hits_per_file'] == 'y') {
    $smarty->assign('hit_limit', $filegallib->get_download_limit($fileId));
}
if (!empty($fileInfo['fileId'])) {
    $smarty->assign('metarray', $filegallib->metadataAction($fileInfo['fileId']), 'get_array');
}
$is_iis = TikiInit::isIIS();
$smarty->assign('is_iis', $is_iis);
$cat_type = 'file';
$cat_objid = (int) $fileId;
include_once 'categorize_list.php';
include_once 'tiki-section_options.php';
ask_ticket('upload-file');
// disallow robots to index page:
$smarty->assign('metatag_robots', 'NOINDEX, NOFOLLOW');
// Display the template
if ($prefs['javascript_enabled'] != 'y' or !$isUpload) {
    if ($prefs['file_galleries_use_jquery_upload'] !== 'y') {
        $headerlib->add_jsfile('vendor/jquery/plugins/form/jquery.form.js');
    }
    $smarty->assign('mid', 'tiki-upload_file.tpl');
    if (!empty($_REQUEST['filegals_manager'])) {
Beispiel #23
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')
Beispiel #24
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 = '';
            }
        }
    }
}
Beispiel #25
0
            $back .= "<b style='font-family: monospace'>Type:</b> {$errstr}";
            $back .= "</div>";
            $phpErrors[] = $back;
            break;
        case E_STRICT:
        case E_NOTICE:
        case E_USER_NOTICE:
        case E_DEPRECATED:
        case E_USER_DEPRECATED:
            if (!defined('THIRD_PARTY_LIBS_PATTERN') || !preg_match(THIRD_PARTY_LIBS_PATTERN, $errfile)) {
                if (!empty($prefs['smarty_notice_reporting']) && $prefs['smarty_notice_reporting'] != 'y' && strstr($errfile, '.tpl.php')) {
                    break;
                }
                $back = "<div class='rbox-data' style='font-size:10px;border:1px solid'>";
                $back .= "<b>PHP (" . PHP_VERSION . ") NOTICE ({$err[$errno]}):</b><br />";
                $back .= "<b style='font-family: monospace'>File:</b> {$errfile}<br />";
                $back .= "<b style='font-family: monospace'>Line:</b> {$errline}<br />";
                $back .= "<b style='font-family: monospace'>Type:</b> {$errstr}";
                $back .= "</div>";
                $phpErrors[] = $back;
            }
        default:
            break;
    }
}
// Patch missing $_SERVER['REQUEST_URI'] on IIS6
if (empty($_SERVER['REQUEST_URI'])) {
    if (TikiInit::isIIS()) {
        $_SERVER['REQUEST_URI'] = $_SERVER['SCRIPT_NAME'];
    }
}
Beispiel #26
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) {
Beispiel #27
0
if (isset($_SERVER['REQUEST_METHOD'])) {
    die('Only available through command-line.');
}
require_once 'tiki-filter-base.php';
require_once 'lib/init/initlib.php';
include_once 'lib/init/tra.php';
require_once 'lib/setup/tikisetup.class.php';
require_once 'lib/setup/twversion.class.php';
$input = new ArgvInput();
if (false !== ($site = $input->getParameterOption(array('--site')))) {
    $_SERVER['TIKI_VIRTUAL'] = $site;
}
$local_php = TikiInit::getCredentialsFile();
$console = new Tiki\Command\Application();
$console->add(new Tiki\Command\ConfigureCommand());
if (is_file($local_php) || TikiInit::getEnvironmentCredentials()) {
    require 'db/tiki-db.php';
    $console->add(new Tiki\Command\InstallCommand());
    $console->add(new Tiki\Command\UpdateCommand());
} else {
    $console->add(new Tiki\Command\UnavailableCommand('database:install'));
    $console->add(new Tiki\Command\UnavailableCommand('database:update'));
}
$installer = $installer = new Installer();
$isInstalled = $installer->isInstalled();
if ($isInstalled) {
    $bypass_siteclose_check = true;
    require_once 'tiki-setup.php';
    $console->add(new Tiki\Command\CacheClearCommand());
    $console->add(new Tiki\Command\BackupDBCommand());
    $console->add(new Tiki\Command\BackupFilesCommand());
}
array_unshift(
				$inputConfiguration, array(
				  'staticKeyFilters' => array(
						'cookietab'	=>	'int',
						'callback'  => 'word',
					),
					'staticKeyFiltersForArrays' => array(
					)
				)
);

require_once('lib/init/initlib.php');
TikiInit::prependIncludePath($tikipath.'lib/pear');
TikiInit::appendIncludePath($tikipath.'lib/core');
TikiInit::appendIncludePath($tikipath);
require_once 'Zend/Loader/Autoloader.php';
Zend_Loader_Autoloader::getInstance()
	->registerNamespace('Horde')
	->registerNamespace('TikiFilter')
	->registerNamespace('DeclFilter')
	->registerNamespace('JisonParser')
	->registerNamespace('JitFilter')
	->registerNamespace('Search')
	->registerNamespace('Perms')
	->registerNamespace('Math')
	->registerNamespace('Category')
	->registerNamespace('WikiParser')
	->registerNamespace('StandardAnalyzer')
	->registerNamespace('Tracker')
	->registerNamespace('Event_')
Beispiel #29
0
 	 			<img src="img/tiki/tikibutton2.png" alt="Tikiwiki" border="0" height="31" width="80">
			</a>
		</p>
	</div>
</body>
</html>
';
    exit;
}
if ($dbversion_tiki == '1.10') {
    $dbversion_tiki = '2.0';
}
if (preg_match('/^adodb$/i', $api_tiki)) {
    TikiInit::prependIncludePath('lib/adodb');
    if (strpos(ini_get('include_path'), 'lib/pear') !== 0) {
        TikiInit::prependIncludePath('lib/pear');
    }
    #error_reporting (E_ALL);       # show any error messages triggered
    define('ADODB_FORCE_NULLS', 1);
    define('ADODB_ASSOC_CASE', 2);
    define('ADODB_CASE_ASSOC', 2);
    // typo in adodb's driver for sybase?
    require_once 'adodb.inc.php';
    include_once 'adodb-pear.inc.php';
    //include_once('adodb-error.inc.php');
    //include_once('adodb-errorhandler.inc.php');
    //include_once('adodb-errorpear.inc.php');
    if ($db_tiki == 'pgsql') {
        $db_tiki = 'postgres7';
    }
    if ($db_tiki == 'sybase') {