diff options
Diffstat (limited to 'Zotlabs')
-rw-r--r-- | Zotlabs/Lib/AConfig.php | 4 | ||||
-rw-r--r-- | Zotlabs/Lib/AbConfig.php | 4 | ||||
-rw-r--r-- | Zotlabs/Lib/Config.php | 6 | ||||
-rw-r--r-- | Zotlabs/Lib/IConfig.php | 6 | ||||
-rw-r--r-- | Zotlabs/Lib/PConfig.php | 6 | ||||
-rw-r--r-- | Zotlabs/Lib/XConfig.php | 6 | ||||
-rw-r--r-- | Zotlabs/Module/Setup.php | 39 | ||||
-rw-r--r-- | Zotlabs/Module/Wiki.php | 1 |
8 files changed, 39 insertions, 33 deletions
diff --git a/Zotlabs/Lib/AConfig.php b/Zotlabs/Lib/AConfig.php index ab8648a18..4e7c5483f 100644 --- a/Zotlabs/Lib/AConfig.php +++ b/Zotlabs/Lib/AConfig.php @@ -10,8 +10,8 @@ class AConfig { return XConfig::Load('a_' . $account_id); } - static public function Get($account_id,$family,$key) { - return XConfig::Get('a_' . $account_id,$family,$key); + static public function Get($account_id,$family,$key,$default = false) { + return XConfig::Get('a_' . $account_id,$family,$key, $default); } static public function Set($account_id,$family,$key,$value) { diff --git a/Zotlabs/Lib/AbConfig.php b/Zotlabs/Lib/AbConfig.php index cb5d96951..dfc9efc6c 100644 --- a/Zotlabs/Lib/AbConfig.php +++ b/Zotlabs/Lib/AbConfig.php @@ -16,7 +16,7 @@ class AbConfig { } - static public function Get($chan,$xhash,$family,$key) { + static public function Get($chan,$xhash,$family,$key, $default = false) { $r = q("select * from abconfig where chan = %d and xchan = '%s' and cat = '%s' and k = '%s' limit 1", intval($chan), dbesc($xhash), @@ -26,7 +26,7 @@ class AbConfig { if($r) { return ((preg_match('|^a:[0-9]+:{.*}$|s', $r[0]['v'])) ? unserialize($r[0]['v']) : $r[0]['v']); } - return false; + return $default; } diff --git a/Zotlabs/Lib/Config.php b/Zotlabs/Lib/Config.php index d4ee1aeda..5625a3f79 100644 --- a/Zotlabs/Lib/Config.php +++ b/Zotlabs/Lib/Config.php @@ -98,13 +98,13 @@ class Config { * @return mixed Return value or false on error or if not set */ - static public function Get($family,$key) { + static public function Get($family,$key,$default = false) { if((! array_key_exists($family, \App::$config)) || (! array_key_exists('config_loaded', \App::$config[$family]))) self::Load($family); if(array_key_exists('config_loaded', \App::$config[$family])) { if(! array_key_exists($key, \App::$config[$family])) { - return false; + return $default; } return ((! is_array(\App::$config[$family][$key])) && (preg_match('|^a:[0-9]+:{.*}$|s', \App::$config[$family][$key])) ? unserialize(\App::$config[$family][$key]) @@ -112,7 +112,7 @@ class Config { ); } - return false; + return $default; } /** diff --git a/Zotlabs/Lib/IConfig.php b/Zotlabs/Lib/IConfig.php index 28c9ab58e..33d94bd49 100644 --- a/Zotlabs/Lib/IConfig.php +++ b/Zotlabs/Lib/IConfig.php @@ -10,7 +10,7 @@ class IConfig { return; } - static public function Get(&$item, $family, $key) { + static public function Get(&$item, $family, $key, $default = false) { $is_item = false; @@ -28,7 +28,7 @@ class IConfig { $iid = $item; if(! $iid) - return false; + return $default; if(is_array($item) && array_key_exists('iconfig',$item) && is_array($item['iconfig'])) { foreach($item['iconfig'] as $c) { @@ -48,7 +48,7 @@ class IConfig { $item['iconfig'][] = $r[0]; return $r[0]['v']; } - return false; + return $default; } diff --git a/Zotlabs/Lib/PConfig.php b/Zotlabs/Lib/PConfig.php index 3b47a250a..d70697fbc 100644 --- a/Zotlabs/Lib/PConfig.php +++ b/Zotlabs/Lib/PConfig.php @@ -67,16 +67,16 @@ class PConfig { * @return mixed Stored value or false if it does not exist */ - static public function Get($uid,$family,$key,$instore = false) { + static public function Get($uid,$family,$key,$default = false) { if(is_null($uid) || $uid === false) - return false; + return $default; if(! array_key_exists($uid, \App::$config)) self::Load($uid); if((! array_key_exists($family, \App::$config[$uid])) || (! array_key_exists($key, \App::$config[$uid][$family]))) - return false; + return $default; return ((! is_array(\App::$config[$uid][$family][$key])) && (preg_match('|^a:[0-9]+:{.*}$|s', \App::$config[$uid][$family][$key])) ? unserialize(\App::$config[$uid][$family][$key]) diff --git a/Zotlabs/Lib/XConfig.php b/Zotlabs/Lib/XConfig.php index 7f3d0f2cd..bf78c360f 100644 --- a/Zotlabs/Lib/XConfig.php +++ b/Zotlabs/Lib/XConfig.php @@ -59,16 +59,16 @@ class XConfig { * @return mixed Stored $value or false if it does not exist */ - static public function Get($xchan, $family, $key) { + static public function Get($xchan, $family, $key, $default = false) { if(! $xchan) - return false; + return $default; if(! array_key_exists($xchan, \App::$config)) load_xconfig($xchan); if((! array_key_exists($family, \App::$config[$xchan])) || (! array_key_exists($key, \App::$config[$xchan][$family]))) - return false; + return $default; return ((! is_array(\App::$config[$xchan][$family][$key])) && (preg_match('|^a:[0-9]+:{.*}$|s', \App::$config[$xchan][$family][$key])) ? unserialize(\App::$config[$xchan][$family][$key]) diff --git a/Zotlabs/Module/Setup.php b/Zotlabs/Module/Setup.php index fde9fe823..b5258a28f 100644 --- a/Zotlabs/Module/Setup.php +++ b/Zotlabs/Module/Setup.php @@ -161,13 +161,6 @@ class Setup extends \Zotlabs\Web\Controller { } } - function get_db_errno() { - if(class_exists('mysqli')) - return mysqli_connect_errno(); - else - return mysql_errno(); - } - /** * @brief Get output for the setup page. * @@ -175,6 +168,7 @@ class Setup extends \Zotlabs\Web\Controller { * * @return string parsed HTML output */ + function get() { $o = ''; @@ -401,7 +395,8 @@ class Setup extends \Zotlabs\Web\Controller { if (strlen($phpath)) { $passed = file_exists($phpath); - } else { + } + elseif(function_exists('shell_exec')) { if(is_windows()) $phpath = trim(shell_exec('where php')); else @@ -426,9 +421,13 @@ class Setup extends \Zotlabs\Web\Controller { if($passed) { $str = autoname(8); $cmd = "$phpath install/testargs.php $str"; - $result = trim(shell_exec($cmd)); - $passed2 = $result == $str; $help = ''; + + if(function_exists('shell_exec')) + $result = trim(shell_exec($cmd)); + else + $help .= t('Unable to check command line PHP, as shell_exec() is disabled. This is required.') . EOL; + $passed2 = (($result == $str) ? true : false); if(!$passed2) { $help .= t('The command line version of PHP on your system does not have "register_argc_argv" enabled.'). EOL; $help .= t('This is required for message delivery to work.'); @@ -457,7 +456,7 @@ class Setup extends \Zotlabs\Web\Controller { userReadableSize($result['max_upload_filesize']), $result['max_file_uploads'] ); - $help .= '<br>' . t('You can adjust these settings in the servers php.ini.'); + $help .= '<br>' . t('You can adjust these settings in the server php.ini file.'); $this->check_add($checks, t('PHP upload limits'), true, false, $help); } @@ -512,11 +511,17 @@ class Setup extends \Zotlabs\Web\Controller { $this->check_add($ck_funcs, t('Apache mod_rewrite module'), true, true); } } - if((! function_exists('proc_open')) || strstr(ini_get('disable_functions'),'proc_open')) { - $this->check_add($ck_funcs, t('proc_open'), false, true, t('Error: proc_open is required but is either not installed or has been disabled in php.ini')); + if((! function_exists('exec')) || strstr(ini_get('disable_functions'),'exec')) { + $this->check_add($ck_funcs, t('exec'), false, true, t('Error: exec is required but is either not installed or has been disabled in php.ini')); + } + else { + $this->check_add($ck_funcs, t('exec'), true, true); + } + if((! function_exists('shell_exec')) || strstr(ini_get('disable_functions'),'shell_exec')) { + $this->check_add($ck_funcs, t('shell_exec'), false, true, t('Error: shell_exec is required but is either not installed or has been disabled in php.ini')); } else { - $this->check_add($ck_funcs, t('proc_open'), true, true); + $this->check_add($ck_funcs, t('shell_exec'), true, true); } if(! function_exists('curl_init')) { @@ -579,7 +584,7 @@ class Setup extends \Zotlabs\Web\Controller { if(! is_writable(TEMPLATE_BUILD_PATH) ) { $status = false; - $help = t('Red uses the Smarty3 template engine to render its web views. Smarty3 compiles templates to PHP to speed up rendering.') .EOL; + $help = t('This software uses the Smarty3 template engine to render its web views. Smarty3 compiles templates to PHP to speed up rendering.') .EOL; $help .= sprintf( t('In order to store these compiled templates, the web server needs to have write access to the directory %s under the top level web folder.'), TEMPLATE_BUILD_PATH) . EOL; $help .= t('Please ensure that the user that your web server runs as (e.g. www-data) has write access to this folder.').EOL; $help .= sprintf( t('Note: as a security measure, you should give the web server write access to %s only--not the template files (.tpl) that it contains.'), TEMPLATE_BUILD_PATH) . EOL; @@ -601,7 +606,7 @@ class Setup extends \Zotlabs\Web\Controller { if(! is_writable('store')) { $status = false; - $help = t('This software uses the store directory to save uploaded files. The web server needs to have write access to the store directory under the Red top level folder') . EOL; + $help = t('This software uses the store directory to save uploaded files. The web server needs to have write access to the store directory under the top level web folder') . EOL; $help .= t('Please ensure that the user that your web server runs as (e.g. www-data) has write access to this folder.').EOL; } @@ -716,7 +721,7 @@ class Setup extends \Zotlabs\Web\Controller { // (e.g. NSS used in RedHat) require different syntax, so hopefully // the default curl cipher list will work for most sites. If not, // this can set via config. Many distros are now disabling RC4, - // but many Red sites still use it and are unable to change it. + // but many existing sites still use it and are unable to change it. // We do not use SSL for encryption, only to protect session cookies. // z_fetch_url() is also used to import shared links and other content // so in theory most any cipher could show up and we should do our best diff --git a/Zotlabs/Module/Wiki.php b/Zotlabs/Module/Wiki.php index da23d67a2..01a1bdc41 100644 --- a/Zotlabs/Module/Wiki.php +++ b/Zotlabs/Module/Wiki.php @@ -149,6 +149,7 @@ class Wiki extends \Zotlabs\Web\Controller { '$wikiName' => array('wikiName', t('Wiki name')), '$mimeType' => array('mimeType', t('Content type'), '', '', ['text/markdown' => 'Markdown', 'text/bbcode' => 'BB Code']), '$name' => t('Name'), + '$type' => t('Type'), '$lockstate' => $x['lockstate'], '$acl' => $x['acl'], '$allow_cid' => $x['allow_cid'], |