From 041f3ca774b07e404c5a9eea6e42c9875d444387 Mon Sep 17 00:00:00 2001 From: Friendika Date: Tue, 8 Mar 2011 18:11:36 -0800 Subject: detect empty .htconfig.php - in case permissions need to be set on it in order to install --- boot.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'boot.php') diff --git a/boot.php b/boot.php index 6bd78b87d..d3380a395 100644 --- a/boot.php +++ b/boot.php @@ -3,7 +3,7 @@ set_time_limit(0); define ( 'BUILD_ID', 1039 ); -define ( 'FRIENDIKA_VERSION', '2.10.0909' ); +define ( 'FRIENDIKA_VERSION', '2.10.0910' ); define ( 'DFRN_PROTOCOL_VERSION', '2.1' ); define ( 'EOL', "
\r\n" ); -- cgit v1.2.3 From 32e96d2647b4f535bf329caf160336f3358ce423 Mon Sep 17 00:00:00 2001 From: Friendika Date: Wed, 9 Mar 2011 02:12:32 -0800 Subject: reload plugins if they change --- boot.php | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 52 insertions(+), 4 deletions(-) (limited to 'boot.php') diff --git a/boot.php b/boot.php index d3380a395..37cd42592 100644 --- a/boot.php +++ b/boot.php @@ -2,8 +2,8 @@ set_time_limit(0); -define ( 'BUILD_ID', 1039 ); -define ( 'FRIENDIKA_VERSION', '2.10.0910' ); +define ( 'BUILD_ID', 1040 ); +define ( 'FRIENDIKA_VERSION', '2.10.0912' ); define ( 'DFRN_PROTOCOL_VERSION', '2.1' ); define ( 'EOL', "
\r\n" ); @@ -512,22 +512,70 @@ function check_config(&$a) { foreach($plugins_arr as $p) { if(! in_array($p,$installed_arr)) { logger("Addons: installing " . $p); + $t = filemtime('addon/' . $p . '/' . $p . '.php'); @include_once('addon/' . $p . '/' . $p . '.php'); if(function_exists($p . '_install')) { $func = $p . '_install'; $func(); - $r = q("INSERT INTO `addon` (`name`, `installed`) VALUES ( '%s', 1 ) ", - dbesc($p) + $r = q("INSERT INTO `addon` (`name`, `installed`, `timestamp`) VALUES ( '%s', 1, %d ) ", + dbesc($p), + intval($t) ); } } } } + + load_hooks(); return; }} +// reload all updated plugins + +if(! function_exists('reload_plugins')) { +function reload_plugins() { + $plugins = get_config('system','addon'); + if(strlen($plugins)) { + + $r = q("SELECT * FROM `addon` WHERE `installed` = 1"); + if(count($r)) + $installed = $r; + else + $installed = array(); + + $parr = explode(',',$plugins); + if(count($parr)) { + foreach($parr as $pl) { + $pl = trim($pl); + + $t = filemtime('addon/' . $pl . '/' . $pl . '.php'); + foreach($installed as $i) { + if(($i['name'] == $pl) && ($i['timestamp'] != $t)) { + logger('Reloading plugin: ' . $i['name']); + @include_once('addon/' . $pl . '/' . $pl . '.php'); + + if(function_exists($pl . '_uninstall')) { + $func = $pl . '_uninstall'; + $func(); + } + if(function_exists($pl . '_install')) { + $func = $pl . '_install'; + $func(); + } + q("UPDATE `addon` SET `timestamp` = %d WHERE `id` = %d LIMIT 1", + intval($t), + intval($i['id']) + ); + } + } + } + } + } +}} + + // This is our template processor. // $s is the string requiring macro substitution. -- cgit v1.2.3 From 7b9dff1db7a1a03e237103ff28a4ec32d40af959 Mon Sep 17 00:00:00 2001 From: Friendika Date: Wed, 9 Mar 2011 16:57:22 -0800 Subject: automated versioning --- boot.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'boot.php') diff --git a/boot.php b/boot.php index 37cd42592..7dd188ee7 100644 --- a/boot.php +++ b/boot.php @@ -2,9 +2,9 @@ set_time_limit(0); -define ( 'BUILD_ID', 1040 ); -define ( 'FRIENDIKA_VERSION', '2.10.0912' ); +define ( 'FRIENDIKA_VERSION', '2.1.913' ); define ( 'DFRN_PROTOCOL_VERSION', '2.1' ); +define ( 'DB_UPDATE_VERSION', 1040 ); define ( 'EOL', "
\r\n" ); define ( 'ATOM_TIME', 'Y-m-d\TH:i:s\Z' ); @@ -435,15 +435,15 @@ function check_config(&$a) { $build = get_config('system','build'); if(! x($build)) - $build = set_config('system','build',BUILD_ID); + $build = set_config('system','build',DB_UPDATE_VERSION); $url = get_config('system','url'); if(! x($url)) $url = set_config('system','url',$a->get_baseurl()); - if($build != BUILD_ID) { + if($build != DB_UPDATE_VERSION) { $stored = intval($build); - $current = intval(BUILD_ID); + $current = intval(DB_UPDATE_VERSION); if(($stored < $current) && file_exists('update.php')) { // We're reporting a different version than what is currently installed. // Run any existing update scripts to bring the database up to current. @@ -455,7 +455,7 @@ function check_config(&$a) { $func($a); } } - set_config('system','build', BUILD_ID); + set_config('system','build', DB_UPDATE_VERSION); } } -- cgit v1.2.3 From 0578751cc9820fcc028d8761e2ba8926dbcfbb05 Mon Sep 17 00:00:00 2001 From: Friendika Date: Wed, 9 Mar 2011 23:35:47 -0800 Subject: allowed_email matching $host instead of $domain --- boot.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'boot.php') diff --git a/boot.php b/boot.php index 7dd188ee7..4c3a923dc 100644 --- a/boot.php +++ b/boot.php @@ -1825,7 +1825,7 @@ function allowed_email($email) { if(count($allowed)) { foreach($allowed as $a) { $pat = strtolower(trim($a)); - if(($fnmatch && fnmatch($pat,$host)) || ($pat == $host)) { + if(($fnmatch && fnmatch($pat,$domain)) || ($pat == $domain)) { $found = true; break; } -- cgit v1.2.3 From 508636082ecc68f61e82770bb671932be2b353bc Mon Sep 17 00:00:00 2001 From: Friendika Date: Thu, 10 Mar 2011 20:46:27 -0800 Subject: bogus 'no results' message on search page --- boot.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'boot.php') diff --git a/boot.php b/boot.php index 4c3a923dc..1412f1f91 100644 --- a/boot.php +++ b/boot.php @@ -2,7 +2,7 @@ set_time_limit(0); -define ( 'FRIENDIKA_VERSION', '2.1.913' ); +define ( 'FRIENDIKA_VERSION', '2.1.914' ); define ( 'DFRN_PROTOCOL_VERSION', '2.1' ); define ( 'DB_UPDATE_VERSION', 1040 ); -- cgit v1.2.3 From 5e2f0ff05596cf572f5fbd0fc1c43b06a394ee31 Mon Sep 17 00:00:00 2001 From: Friendika Date: Fri, 11 Mar 2011 14:48:58 -0800 Subject: roll back "real people preferred" message - ineffectual --- boot.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'boot.php') diff --git a/boot.php b/boot.php index 1412f1f91..bbaa8324d 100644 --- a/boot.php +++ b/boot.php @@ -2,7 +2,7 @@ set_time_limit(0); -define ( 'FRIENDIKA_VERSION', '2.1.914' ); +define ( 'FRIENDIKA_VERSION', '2.1.915' ); define ( 'DFRN_PROTOCOL_VERSION', '2.1' ); define ( 'DB_UPDATE_VERSION', 1040 ); -- cgit v1.2.3