aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs
diff options
context:
space:
mode:
Diffstat (limited to 'Zotlabs')
-rw-r--r--Zotlabs/Lib/AConfig.php2
-rw-r--r--Zotlabs/Lib/Apps.php2
-rw-r--r--Zotlabs/Module/Admin.php26
-rw-r--r--Zotlabs/Module/Help.php5
-rw-r--r--Zotlabs/Module/Register.php2
-rw-r--r--Zotlabs/Module/Setup.php7
-rwxr-xr-xZotlabs/Render/SmartyTemplate.php5
7 files changed, 31 insertions, 18 deletions
diff --git a/Zotlabs/Lib/AConfig.php b/Zotlabs/Lib/AConfig.php
index 24ec97dfa..ab8648a18 100644
--- a/Zotlabs/Lib/AConfig.php
+++ b/Zotlabs/Lib/AConfig.php
@@ -15,7 +15,7 @@ class AConfig {
}
static public function Set($account_id,$family,$key,$value) {
- return XConfig::Get('a_' . $account_id,$family,$key,$value);
+ return XConfig::Set('a_' . $account_id,$family,$key,$value);
}
static public function Delete($account_id,$family,$key) {
diff --git a/Zotlabs/Lib/Apps.php b/Zotlabs/Lib/Apps.php
index 19ed1b612..a646d8a30 100644
--- a/Zotlabs/Lib/Apps.php
+++ b/Zotlabs/Lib/Apps.php
@@ -112,7 +112,7 @@ class Apps {
static public function app_name_compare($a,$b) {
- return strcmp($a['name'],$b['name']);
+ return strcasecmp($a['name'],$b['name']);
}
diff --git a/Zotlabs/Module/Admin.php b/Zotlabs/Module/Admin.php
index 15edbd407..fa4f32c8c 100644
--- a/Zotlabs/Module/Admin.php
+++ b/Zotlabs/Module/Admin.php
@@ -289,8 +289,6 @@ class Admin extends \Zotlabs\Web\Controller {
$mirror_frontpage = ((x($_POST,'mirror_frontpage')) ? intval(trim($_POST['mirror_frontpage'])) : 0);
$directory_server = ((x($_POST,'directory_server')) ? trim($_POST['directory_server']) : '');
$allowed_sites = ((x($_POST,'allowed_sites')) ? notags(trim($_POST['allowed_sites'])) : '');
- $allowed_email = ((x($_POST,'allowed_email')) ? notags(trim($_POST['allowed_email'])) : '');
- $not_allowed_email = ((x($_POST,'not_allowed_email')) ? notags(trim($_POST['not_allowed_email'])) : '');
$force_publish = ((x($_POST,'publish_all')) ? True : False);
$disable_discover_tab = ((x($_POST,'disable_discover_tab')) ? False : True);
$login_on_homepage = ((x($_POST,'login_on_homepage')) ? True : False);
@@ -357,8 +355,6 @@ class Admin extends \Zotlabs\Web\Controller {
set_config('system','account_abandon_days', $abandon_days);
set_config('system','register_text', $register_text);
set_config('system','allowed_sites', $allowed_sites);
- set_config('system','allowed_email', $allowed_email);
- set_config('system','not_allowed_email', $not_allowed_email);
set_config('system','publish_all', $force_publish);
set_config('system','disable_discover_tab', $disable_discover_tab);
if ($global_directory == '') {
@@ -527,8 +523,6 @@ class Admin extends \Zotlabs\Web\Controller {
'$mirror_frontpage' => array('mirror_frontpage', t("Preserve site homepage URL"), get_config('system','mirror_frontpage'), t('Present the site homepage in a frame at the original location instead of redirecting')),
'$abandon_days' => array('abandon_days', t('Accounts abandoned after x days'), get_config('system','account_abandon_days'), t('Will not waste system resources polling external sites for abandonded accounts. Enter 0 for no time limit.')),
'$allowed_sites' => array('allowed_sites', t("Allowed friend domains"), get_config('system','allowed_sites'), t("Comma separated list of domains which are allowed to establish friendships with this site. Wildcards are accepted. Empty to allow any domains")),
- '$allowed_email' => array('allowed_email', t("Allowed email domains"), get_config('system','allowed_email'), t("Comma separated list of domains which are allowed in email addresses for registrations to this site. Wildcards are accepted. Empty to allow any domains")),
- '$not_allowed_email' => array('not_allowed_email', t("Not allowed email domains"), get_config('system','not_allowed_email'), t("Comma separated list of domains which are not allowed in email addresses for registrations to this site. Wildcards are accepted. Empty to allow any domains, unless allowed domains have been defined.")),
'$verify_email' => array('verify_email', t("Verify Email Addresses"), get_config('system','verify_email'), t("Check to verify email addresses used in account registration (recommended).")),
'$force_publish' => array('publish_all', t("Force publish"), get_config('system','publish_all'), t("Check to force all profiles on this site to be listed in the site directory.")),
'$disable_discover_tab' => array('disable_discover_tab', t('Import Public Streams'), $discover_tab, t('Import and allow access to public content pulled from other sites. Warning: this content is unmoderated.')),
@@ -604,8 +598,12 @@ class Admin extends \Zotlabs\Web\Controller {
function admin_page_security_post(&$a){
check_form_security_token_redirectOnErr('/admin/security', 'admin_security');
- logger('post: ' . print_r($_POST,true));
-
+ $allowed_email = ((x($_POST,'allowed_email')) ? notags(trim($_POST['allowed_email'])) : '');
+ $not_allowed_email = ((x($_POST,'not_allowed_email')) ? notags(trim($_POST['not_allowed_email'])) : '');
+
+ set_config('system','allowed_email', $allowed_email);
+ set_config('system','not_allowed_email', $not_allowed_email);
+
$block_public = ((x($_POST,'block_public')) ? True : False);
set_config('system','block_public',$block_public);
@@ -771,6 +769,8 @@ class Admin extends \Zotlabs\Web\Controller {
'$block_public' => array('block_public', t("Block public"), get_config('system','block_public'), t("Check to block public access to all otherwise public personal pages on this site unless you are currently authenticated.")),
'$transport_security' => array('transport_security', t('Set "Transport Security" HTTP header'),intval(get_config('system','transport_security_header')),''),
'$content_security' => array('content_security', t('Set "Content Security Policy" HTTP header'),intval(get_config('system','content_security_policy')),''),
+ '$allowed_email' => array('allowed_email', t("Allowed email domains"), get_config('system','allowed_email'), t("Comma separated list of domains which are allowed in email addresses for registrations to this site. Wildcards are accepted. Empty to allow any domains")),
+ '$not_allowed_email' => array('not_allowed_email', t("Not allowed email domains"), get_config('system','not_allowed_email'), t("Comma separated list of domains which are not allowed in email addresses for registrations to this site. Wildcards are accepted. Empty to allow any domains, unless allowed domains have been defined.")),
'$whitelisted_sites' => array('whitelisted_sites', t('Allow communications only from these sites'), $whitesites_str, t('One site per line. Leave empty to allow communication from anywhere by default')),
'$blacklisted_sites' => array('blacklisted_sites', t('Block communications from these sites'), $blacksites_str, ''),
'$whitelisted_channels' => array('whitelisted_channels', t('Allow communications only from these channels'), $whitechannels_str, t('One channel (hash) per line. Leave empty to allow from any channel by default')),
@@ -1288,19 +1288,27 @@ class Admin extends \Zotlabs\Web\Controller {
if (x($_GET,"a") && $_GET['a']=="t"){
check_form_security_token_redirectOnErr('/admin/plugins', 'admin_plugins', 't');
-
+ $pinstalled = false;
// Toggle plugin status
$idx = array_search($plugin, \App::$plugins);
if ($idx !== false){
unset(\App::$plugins[$idx]);
uninstall_plugin($plugin);
+ $pinstalled = false;
info( sprintf( t("Plugin %s disabled."), $plugin ) );
} else {
\App::$plugins[] = $plugin;
install_plugin($plugin);
+ $pinstalled = true;
info( sprintf( t("Plugin %s enabled."), $plugin ) );
}
set_config("system","addon", implode(", ",\App::$plugins));
+
+ if($pinstalled) {
+ @require_once("addon/$plugin/$plugin.php");
+ if(function_exists($plugin.'_plugin_admin'))
+ goaway(z_root() . '/admin/plugins/' . $plugin);
+ }
goaway(z_root() . '/admin/plugins' );
}
// display plugin details
diff --git a/Zotlabs/Module/Help.php b/Zotlabs/Module/Help.php
index 479925b66..241354d07 100644
--- a/Zotlabs/Module/Help.php
+++ b/Zotlabs/Module/Help.php
@@ -36,8 +36,9 @@ class Help extends \Zotlabs\Web\Controller {
$fname = substr($fname,0,strrpos($fname,'.'));
$path = trim(substr($dirname,4),'/');
- $o .= '<li><a href="help/' . (($path) ? $path . '/' : '') . $fname . '" >' . ucwords(str_replace('_',' ',notags($fname))) . '</a><br />' .
- str_replace('$Projectname',\Zotlabs\Lib\System::get_platform_name(),substr($rr['text'],0,200)) . '...<br /><br /></li>';
+ $o .= '<li><a href="help/' . (($path) ? $path . '/' : '') . $fname . '" >' . ucwords(str_replace('_',' ',notags($fname))) . '</a><br />'
+ . '<b><i>' . 'help/' . (($path) ? $path . '/' : '') . $fname . '</i></b><br />' .
+ '...' . str_replace('$Projectname',\Zotlabs\Lib\System::get_platform_name(),$rr['text']) . '...<br /><br /></li>';
}
$o .= '</ul>';
diff --git a/Zotlabs/Module/Register.php b/Zotlabs/Module/Register.php
index 4cdd27001..0b16d4a66 100644
--- a/Zotlabs/Module/Register.php
+++ b/Zotlabs/Module/Register.php
@@ -38,7 +38,7 @@ class Register extends \Zotlabs\Web\Controller {
}
- function post() {
+ function post() {
$max_dailies = intval(get_config('system','max_daily_registrations'));
if($max_dailies) {
diff --git a/Zotlabs/Module/Setup.php b/Zotlabs/Module/Setup.php
index f8e210410..610f3c4f4 100644
--- a/Zotlabs/Module/Setup.php
+++ b/Zotlabs/Module/Setup.php
@@ -43,11 +43,12 @@ class Setup extends \Zotlabs\Web\Controller {
killme();
}
- if (x($_POST, 'pass'))
+ if (x($_POST, 'pass')) {
$this->install_wizard_pass = intval($_POST['pass']);
- else
+ }
+ else {
$this->install_wizard_pass = 1;
-
+ }
}
/**
diff --git a/Zotlabs/Render/SmartyTemplate.php b/Zotlabs/Render/SmartyTemplate.php
index b7e68c1bc..7abe0731c 100755
--- a/Zotlabs/Render/SmartyTemplate.php
+++ b/Zotlabs/Render/SmartyTemplate.php
@@ -15,7 +15,10 @@ class SmartyTemplate implements TemplateEngine {
? \App::$config['system']['smarty3_folder'] : '');
if (!$basecompiledir) $basecompiledir = str_replace('Zotlabs','',dirname(__dir__)) . "/" . TEMPLATE_BUILD_PATH;
if (!is_dir($basecompiledir)) {
- echo "<b>ERROR:</b> folder <tt>$basecompiledir</tt> does not exist."; killme();
+ @os_mkdir(TEMPLATE_BUILD_PATH, STORAGE_DEFAULT_PERMISSIONS, true);
+ if (!is_dir($basecompiledir)) {
+ echo "<b>ERROR:</b> folder <tt>$basecompiledir</tt> does not exist."; killme();
+ }
}
if(!is_writable($basecompiledir)){
echo "<b>ERROR:</b> folder <tt>$basecompiledir</tt> must be writable by webserver."; killme();