diff options
-rw-r--r-- | Zotlabs/Lib/Apps.php | 13 | ||||
-rw-r--r-- | Zotlabs/Module/Probe.php | 7 | ||||
-rw-r--r-- | Zotlabs/Module/Zfinger.php | 4 | ||||
-rw-r--r-- | Zotlabs/Update/_1217.php | 22 | ||||
-rwxr-xr-x | boot.php | 2 | ||||
-rw-r--r-- | install/schema_mysql.sql | 1 | ||||
-rw-r--r-- | install/schema_postgres.sql | 1 |
7 files changed, 38 insertions, 12 deletions
diff --git a/Zotlabs/Lib/Apps.php b/Zotlabs/Lib/Apps.php index f7aff1722..9027b13bc 100644 --- a/Zotlabs/Lib/Apps.php +++ b/Zotlabs/Lib/Apps.php @@ -927,10 +927,11 @@ class Apps { $darray['app_requires'] = ((x($arr,'requires')) ? escape_tags($arr['requires']) : ''); $darray['app_system'] = ((x($arr,'system')) ? intval($arr['system']) : 0); $darray['app_deleted'] = ((x($arr,'deleted')) ? intval($arr['deleted']) : 0); + $darray['app_options'] = ((x($arr,'options')) ? intval($arr['options']) : 0); $created = datetime_convert(); - $r = q("insert into app ( app_id, app_sig, app_author, app_name, app_desc, app_url, app_photo, app_version, app_channel, app_addr, app_price, app_page, app_requires, app_created, app_edited, app_system, app_plugin, app_deleted ) values ( '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', %d, '%s', '%s', '%s', '%s', '%s', '%s', %d, '%s', %d )", + $r = q("insert into app ( app_id, app_sig, app_author, app_name, app_desc, app_url, app_photo, app_version, app_channel, app_addr, app_price, app_page, app_requires, app_created, app_edited, app_system, app_plugin, app_deleted, app_options ) values ( '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', %d, '%s', '%s', '%s', '%s', '%s', '%s', %d, '%s', %d, %d )", dbesc($darray['app_id']), dbesc($darray['app_sig']), dbesc($darray['app_author']), @@ -948,7 +949,8 @@ class Apps { dbesc($created), intval($darray['app_system']), dbesc($darray['app_plugin']), - intval($darray['app_deleted']) + intval($darray['app_deleted']), + intval($darray['app_options']) ); if($r) { @@ -1009,10 +1011,11 @@ class Apps { $darray['app_requires'] = ((x($arr,'requires')) ? escape_tags($arr['requires']) : ''); $darray['app_system'] = ((x($arr,'system')) ? intval($arr['system']) : 0); $darray['app_deleted'] = ((x($arr,'deleted')) ? intval($arr['deleted']) : 0); + $darray['app_options'] = ((x($arr,'options')) ? intval($arr['options']) : 0); $edited = datetime_convert(); - $r = q("update app set app_sig = '%s', app_author = '%s', app_name = '%s', app_desc = '%s', app_url = '%s', app_photo = '%s', app_version = '%s', app_addr = '%s', app_price = '%s', app_page = '%s', app_requires = '%s', app_edited = '%s', app_system = %d, app_plugin = '%s', app_deleted = %d where app_id = '%s' and app_channel = %d", + $r = q("update app set app_sig = '%s', app_author = '%s', app_name = '%s', app_desc = '%s', app_url = '%s', app_photo = '%s', app_version = '%s', app_addr = '%s', app_price = '%s', app_page = '%s', app_requires = '%s', app_edited = '%s', app_system = %d, app_plugin = '%s', app_deleted = %d, app_options = %d where app_id = '%s' and app_channel = %d", dbesc($darray['app_sig']), dbesc($darray['app_author']), dbesc($darray['app_name']), @@ -1028,6 +1031,7 @@ class Apps { intval($darray['app_system']), dbesc($darray['app_plugin']), intval($darray['app_deleted']), + intval($darray['app_options']), dbesc($darray['app_id']), intval($darray['app_channel']) ); @@ -1117,6 +1121,9 @@ class Apps { if($app['app_system']) $ret['system'] = $app['app_system']; + if($app['app_options']) + $ret['options'] = $app['app_options']; + if($app['app_plugin']) $ret['plugin'] = trim($app['app_plugin']); diff --git a/Zotlabs/Module/Probe.php b/Zotlabs/Module/Probe.php index 2e65f107c..2c67c6aae 100644 --- a/Zotlabs/Module/Probe.php +++ b/Zotlabs/Module/Probe.php @@ -27,12 +27,11 @@ class Probe extends \Zotlabs\Web\Controller { $o .= '<pre>'; if(! $j['success']) { - $o .= sprintf( t('Fetching URL returns error: %1$s'),$res['error'] . "\r\n\r\n"); $o .= "<strong>https connection failed. Trying again with auto failover to http.</strong>\r\n\r\n"; $j = \Zotlabs\Zot\Finger::run($addr,$channel,true); - if(! $j['success']) - $o .= sprintf( t('Fetching URL returns error: %1$s'),$res['error'] . "\r\n\r\n"); - + if(! $j['success']) { + return $o; + } } if($do_import && $j) $x = import_xchan($j); diff --git a/Zotlabs/Module/Zfinger.php b/Zotlabs/Module/Zfinger.php index 0f7f6a64b..6ed001df5 100644 --- a/Zotlabs/Module/Zfinger.php +++ b/Zotlabs/Module/Zfinger.php @@ -36,10 +36,6 @@ class Zfinger extends \Zotlabs\Web\Controller { echo $ret; killme(); - - - - json_return_and_die($x); } diff --git a/Zotlabs/Update/_1217.php b/Zotlabs/Update/_1217.php new file mode 100644 index 000000000..15d2d06b3 --- /dev/null +++ b/Zotlabs/Update/_1217.php @@ -0,0 +1,22 @@ +<?php + +namespace Zotlabs\Update; + +class _1217 { + + function run() { + if(ACTIVE_DBTYPE == DBTYPE_POSTGRES) { + $r = q("ALTER TABLE app ADD app_options smallint NOT NULL DEFAULT '0' "); + } + else { + $r = q("ALTER TABLE app ADD app_options int(11) NOT NULL DEFAULT 0 "); + + } + + if($r) { + return UPDATE_SUCCESS; + } + return UPDATE_FAILED; + } +} + @@ -54,7 +54,7 @@ define ( 'STD_VERSION', '3.7.1' ); define ( 'ZOT_REVISION', '6.0a' ); -define ( 'DB_UPDATE_VERSION', 1216 ); +define ( 'DB_UPDATE_VERSION', 1217 ); define ( 'PROJECT_BASE', __DIR__ ); diff --git a/install/schema_mysql.sql b/install/schema_mysql.sql index 9685a878e..b556b15cd 100644 --- a/install/schema_mysql.sql +++ b/install/schema_mysql.sql @@ -127,6 +127,7 @@ CREATE TABLE IF NOT EXISTS `app` ( `app_deleted` int(11) NOT NULL DEFAULT 0 , `app_system` int(11) NOT NULL DEFAULT 0 , `app_plugin` char(191) NOT NULL DEFAULT '', + `app_options` int(11) NOT NULL DEFAULT 0 , `app_created` datetime NOT NULL DEFAULT '0001-01-01 00:00:00', `app_edited` datetime NOT NULL DEFAULT '0001-01-01 00:00:00', PRIMARY KEY (`id`), diff --git a/install/schema_postgres.sql b/install/schema_postgres.sql index d4ffed130..8db0eb8be 100644 --- a/install/schema_postgres.sql +++ b/install/schema_postgres.sql @@ -125,6 +125,7 @@ CREATE TABLE "app" ( "app_deleted" smallint NOT NULL DEFAULT '0', "app_system" smallint NOT NULL DEFAULT '0', "app_plugin" text NOT NULL DEFAULT '', + "app_options" smallint NOT NULL DEFAULT '0', "app_created" timestamp NOT NULL DEFAULT '0001-01-01 00:00:00', "app_edited" timestamp NOT NULL DEFAULT '0001-01-01 00:00:00', PRIMARY KEY ("id") |