diff options
Diffstat (limited to 'boot.php')
-rwxr-xr-x | boot.php | 77 |
1 files changed, 55 insertions, 22 deletions
@@ -50,10 +50,11 @@ require_once('include/attach.php'); require_once('include/bbcode.php'); define ( 'PLATFORM_NAME', 'hubzilla' ); -define ( 'STD_VERSION', '3.3.1' ); -define ( 'ZOT_REVISION', '1.3' ); +define ( 'STD_VERSION', '3.5.6' ); +define ( 'ZOT_REVISION', '6.0a' ); -define ( 'DB_UPDATE_VERSION', 1206 ); + +define ( 'DB_UPDATE_VERSION', 1215 ); define ( 'PROJECT_BASE', __DIR__ ); @@ -80,11 +81,12 @@ define ( 'DIRECTORY_MODE_STANDALONE', 0x0100); // A detached (off the grid) hub // point to go out and find the rest of the world. define ( 'DIRECTORY_REALM', 'RED_GLOBAL'); -define ( 'DIRECTORY_FALLBACK_MASTER', 'https://gravizot.de'); +define ( 'DIRECTORY_FALLBACK_MASTER', 'https://zotadel.net'); $DIRECTORY_FALLBACK_SERVERS = array( 'https://hubzilla.zottel.net', - 'https://gravizot.de' + 'https://gravizot.de', + 'https://zotadel.net' ); @@ -402,6 +404,7 @@ define ( 'VNOTIFY_INTRO', 0x0200 ); define ( 'VNOTIFY_REGISTER', 0x0400 ); define ( 'VNOTIFY_FILES', 0x0800 ); define ( 'VNOTIFY_PUBS', 0x1000 ); +define ( 'VNOTIFY_LIKE', 0x2000 ); @@ -478,6 +481,7 @@ define ( 'ACTIVITY_ABSTAIN', NAMESPACE_ZOT . '/activity/abstain' ); define ( 'ACTIVITY_ATTEND', NAMESPACE_ZOT . '/activity/attendyes' ); define ( 'ACTIVITY_ATTENDNO', NAMESPACE_ZOT . '/activity/attendno' ); define ( 'ACTIVITY_ATTENDMAYBE', NAMESPACE_ZOT . '/activity/attendmaybe' ); +define ( 'ACTIVITY_POLLRESPONSE', NAMESPACE_ZOT . '/activity/pollresponse' ); define ( 'ACTIVITY_OBJ_HEART', NAMESPACE_ZOT . '/activity/heart' ); @@ -855,7 +859,7 @@ class App { self::$scheme = 'https'; if(x($_SERVER,'SERVER_NAME')) { - self::$hostname = $_SERVER['SERVER_NAME']; + self::$hostname = punify($_SERVER['SERVER_NAME']); if(x($_SERVER,'SERVER_PORT') && $_SERVER['SERVER_PORT'] != 80 && $_SERVER['SERVER_PORT'] != 443) self::$hostname .= ':' . $_SERVER['SERVER_PORT']; @@ -882,7 +886,7 @@ class App { // unix style "homedir" - if(substr(self::$cmd, 0, 1) === '~') + if((substr(self::$cmd, 0, 1) === '~') || (substr(self::$cmd, 0, 1) === '@')) self::$cmd = 'channel/' . substr(self::$cmd, 1); /* @@ -952,6 +956,9 @@ class App { && is_array(self::$config['system']) && array_key_exists('baseurl',self::$config['system']) && strlen(self::$config['system']['baseurl'])) { + // get_baseurl() is a heavily used function. + // Do not use punify() here until we find a library that performs better than what we have now. + //$url = punify(self::$config['system']['baseurl']); $url = self::$config['system']['baseurl']; $url = trim($url,'\\/'); return $url; @@ -959,7 +966,7 @@ class App { $scheme = self::$scheme; - self::$baseurl = $scheme . "://" . self::$hostname . ((isset(self::$path) && strlen(self::$path)) ? '/' . self::$path : '' ); + self::$baseurl = $scheme . "://" . punify(self::$hostname) . ((isset(self::$path) && strlen(self::$path)) ? '/' . self::$path : '' ); return self::$baseurl; } @@ -970,7 +977,7 @@ class App { && is_array(self::$config['system']) && array_key_exists('baseurl',self::$config['system']) && strlen(self::$config['system']['baseurl'])) { - $url = self::$config['system']['baseurl']; + $url = punify(self::$config['system']['baseurl']); $url = trim($url,'\\/'); } @@ -981,7 +988,7 @@ class App { if($parsed !== false) { self::$scheme = $parsed['scheme']; - self::$hostname = $parsed['host']; + self::$hostname = punify($parsed['host']); if(x($parsed,'port')) self::$hostname .= ':' . $parsed['port']; if(x($parsed,'path')) @@ -1552,17 +1559,43 @@ function fix_system_urls($oldurl, $newurl) { * @return string Parsed HTML code. */ function login($register = false, $form_id = 'main-login', $hiddens = false, $login_page = true) { + $o = ''; - $reg = false; - $reglink = get_config('system', 'register_link'); - if(! strlen($reglink)) - $reglink = 'register'; - - $reg = array( - 'title' => t('Create an account to access services and applications'), - 'desc' => t('Register'), - 'link' => (($register) ? $reglink : 'pubsites') - ); + $reg = null; + + // Here's the current description of how the register link works (2018-05-15) + + // Register links are enabled on the site home page and login page and navbar. + // They are not shown by default on other pages which may require login. + + // If the register link is enabled and registration is closed, the request is directed + // to /pubsites. If registration is allowed, /register is the default destination + + // system.register_link can over-ride the default behaviour and redirect to an arbitrary + // webpage for paid/custom or organisational registrations, regardless of whether + // registration is allowed. + + // system.register_link may or may not be the same destination as system.sellpage + + // system.sellpage is the destination linked from the /pubsites page on other sites. If + // system.sellpage is not set, the 'register' link in /pubsites will go to 'register' on your + // site. + + // If system.register_link is set to the word 'none', no registration link will be shown on + // your site. + + + $register_policy = get_config('system','register_policy'); + + $reglink = get_config('system', 'register_link', z_root() . '/' . ((intval($register_policy) === REGISTER_CLOSED) ? 'pubsites' : 'register')); + + if($reglink !== 'none') { + $reg = [ + 'title' => t('Create an account to access services and applications'), + 'desc' => t('Register'), + 'link' => $reglink + ]; + } $dest_url = z_root() . '/' . App::$query_string; @@ -2486,8 +2519,8 @@ function check_cron_broken() { * @return boolean */ function observer_prohibited($allow_account = false) { - if($allow_account) + if($allow_account) { return (((get_config('system', 'block_public')) && (! get_account_id()) && (! remote_channel())) ? true : false ); - + } return (((get_config('system', 'block_public')) && (! local_channel()) && (! remote_channel())) ? true : false ); } |