aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Zotlabs/Module/Authtest.php31
-rw-r--r--Zotlabs/Module/Fhublocs.php1
-rw-r--r--Zotlabs/Module/Import.php1
-rw-r--r--Zotlabs/Module/Notes.php1
-rw-r--r--Zotlabs/Module/Profiles.php1
-rw-r--r--Zotlabs/Module/Rbmark.php67
-rw-r--r--Zotlabs/Module/Rpost.php1
-rw-r--r--Zotlabs/Module/Settings.php45
-rw-r--r--Zotlabs/Module/Wfinger.php8
-rw-r--r--include/bbcode.php1
-rw-r--r--include/channel.php1
-rwxr-xr-xutil/fresh23
-rwxr-xr-xutil/pconfig3
13 files changed, 84 insertions, 100 deletions
diff --git a/Zotlabs/Module/Authtest.php b/Zotlabs/Module/Authtest.php
index 239ae3bdb..d85af09dc 100644
--- a/Zotlabs/Module/Authtest.php
+++ b/Zotlabs/Module/Authtest.php
@@ -1,41 +1,38 @@
<?php
namespace Zotlabs\Module;
-require_once('include/zot.php');
-
-
class Authtest extends \Zotlabs\Web\Controller {
function get() {
-
-
+
+
$auth_success = false;
$o .= '<h3>Magic-Auth Diagnostic</h3>';
-
+
if(! local_channel()) {
notice( t('Permission denied.') . EOL);
return $o;
}
-
+
$o .= '<form action="authtest" method="get">';
$o .= 'Target URL: <input type="text" style="width: 250px;" name="dest" value="' . $_GET['dest'] .'" />';
- $o .= '<input type="submit" name="submit" value="Submit" /></form>';
-
+ $o .= '<input type="submit" name="submit" value="Submit" /></form>';
+
$o .= '<br /><br />';
-
+
if(x($_GET,'dest')) {
if(strpos($_GET['dest'],'@')) {
$_GET['dest'] = $_REQUEST['dest'] = 'https://' . substr($_GET['dest'],strpos($_GET['dest'],'@')+1) . '/channel/' . substr($_GET['dest'],0,strpos($_GET['dest'],'@'));
}
-
+
$_REQUEST['test'] = 1;
$mod = new Magic();
$x = $mod->init($a);
$o .= 'Local Setup returns: ' . print_r($x,true);
-
-
-
+
+
+
if($x['url']) {
$z = z_fetch_url($x['url'] . '&test=1');
if($z['success']) {
@@ -50,12 +47,12 @@ class Authtest extends \Zotlabs\Web\Controller {
$o .= 'fetch url failure.' . print_r($z,true);
}
}
-
+
if(! $auth_success)
$o .= 'Authentication Failed!' . EOL;
}
-
+
return str_replace("\n",'<br />',$o);
}
-
+
}
diff --git a/Zotlabs/Module/Fhublocs.php b/Zotlabs/Module/Fhublocs.php
index 4918f751b..9dcece715 100644
--- a/Zotlabs/Module/Fhublocs.php
+++ b/Zotlabs/Module/Fhublocs.php
@@ -3,7 +3,6 @@ namespace Zotlabs\Module;
use Zotlabs\Lib\Libzot;
-require_once('include/zot.php');
require_once('include/crypto.php');
/* fix missing or damaged hublocs */
diff --git a/Zotlabs/Module/Import.php b/Zotlabs/Module/Import.php
index bfd248a0f..59db7b4be 100644
--- a/Zotlabs/Module/Import.php
+++ b/Zotlabs/Module/Import.php
@@ -2,7 +2,6 @@
namespace Zotlabs\Module;
-require_once('include/zot.php');
require_once('include/channel.php');
require_once('include/import.php');
require_once('include/perm_upgrade.php');
diff --git a/Zotlabs/Module/Notes.php b/Zotlabs/Module/Notes.php
index b448cff83..452e3df60 100644
--- a/Zotlabs/Module/Notes.php
+++ b/Zotlabs/Module/Notes.php
@@ -38,7 +38,6 @@ class Notes extends Controller {
// push updates to channel clones
if((argc() > 1) && (argv(1) === 'sync')) {
- require_once('include/zot.php');
Libsync::build_sync_packet();
}
diff --git a/Zotlabs/Module/Profiles.php b/Zotlabs/Module/Profiles.php
index 9aa342223..452af4d78 100644
--- a/Zotlabs/Module/Profiles.php
+++ b/Zotlabs/Module/Profiles.php
@@ -600,7 +600,6 @@ class Profiles extends \Zotlabs\Web\Controller {
intval(local_channel())
);
if($r) {
- require_once('include/zot.php');
Libsync::build_sync_packet(local_channel(),array('profile' => $r));
}
diff --git a/Zotlabs/Module/Rbmark.php b/Zotlabs/Module/Rbmark.php
index 226cef69e..87b774495 100644
--- a/Zotlabs/Module/Rbmark.php
+++ b/Zotlabs/Module/Rbmark.php
@@ -6,12 +6,11 @@ require_once('include/crypto.php');
require_once('include/items.php');
require_once('include/taxonomy.php');
require_once('include/conversation.php');
-require_once('include/zot.php');
require_once('include/bookmarks.php');
/**
* remote bookmark
- *
+ *
* https://yoursite/rbmark?f=&title=&url=&private=&remote_return=
*
* This can be called via either GET or POST, use POST for long body content as suhosin often limits GET parameter length
@@ -31,45 +30,45 @@ class Rbmark extends \Zotlabs\Web\Controller {
function post() {
if($_POST['submit'] !== t('Save'))
return;
-
+
logger('rbmark_post: ' . print_r($_REQUEST,true));
-
+
$channel = \App::get_channel();
-
+
$t = array('url' => escape_tags($_REQUEST['url']),'term' => escape_tags($_REQUEST['title']));
bookmark_add($channel,$channel,$t,((x($_REQUEST,'private')) ? intval($_REQUEST['private']) : 0),
array('menu_id' => ((x($_REQUEST,'menu_id')) ? intval($_REQUEST['menu_id']) : 0),
'menu_name' => ((x($_REQUEST,'menu_name')) ? escape_tags($_REQUEST['menu_name']) : ''),
'ischat' => ((x($_REQUEST['ischat'])) ? intval($_REQUEST['ischat']) : 0)
));
-
+
goaway(z_root() . '/bookmarks');
-
+
}
-
-
+
+
function get() {
-
+
$o = '';
-
+
if(! local_channel()) {
-
+
// The login procedure is going to bugger our $_REQUEST variables
// so save them in the session.
-
+
if(array_key_exists('url',$_REQUEST)) {
$_SESSION['bookmark'] = $_REQUEST;
}
return login();
}
-
+
// If we have saved rbmark session variables, but nothing in the current $_REQUEST, recover the saved variables
-
+
if((! array_key_exists('url',$_REQUEST)) && (array_key_exists('bookmark',$_SESSION))) {
$_REQUEST = $_SESSION['bookmark'];
unset($_SESSION['bookmark']);
}
-
+
if($_REQUEST['remote_return']) {
$_SESSION['remote_return'] = $_REQUEST['remote_return'];
}
@@ -78,12 +77,12 @@ class Rbmark extends \Zotlabs\Web\Controller {
goaway($_SESSION['remote_return']);
goaway(z_root() . '/bookmarks');
}
-
+
$channel = \App::get_channel();
-
-
+
+
$m = menu_list($channel['channel_id'],'',MENU_BOOKMARK);
-
+
$menus = array();
if($m) {
$menus = array(0 => '');
@@ -92,10 +91,10 @@ class Rbmark extends \Zotlabs\Web\Controller {
}
}
$menu_select = array('menu_id',t('Select a bookmark folder'),false,'',$menus);
-
-
+
+
$o .= replace_macros(get_markup_template('rbmark.tpl'), array(
-
+
'$header' => t('Save Bookmark'),
'$url' => array('url',t('URL of bookmark'),escape_tags($_REQUEST['url'])),
'$title' => array('title',t('Description'),escape_tags($_REQUEST['title'])),
@@ -104,18 +103,18 @@ class Rbmark extends \Zotlabs\Web\Controller {
'$submit' => t('Save'),
'$menu_name' => array('menu_name',t('Or enter new bookmark folder name'),'',''),
'$menus' => $menu_select
-
+
));
-
-
-
-
-
-
+
+
+
+
+
+
return $o;
-
+
}
-
-
-
+
+
+
}
diff --git a/Zotlabs/Module/Rpost.php b/Zotlabs/Module/Rpost.php
index ff306d138..80ad289b2 100644
--- a/Zotlabs/Module/Rpost.php
+++ b/Zotlabs/Module/Rpost.php
@@ -8,7 +8,6 @@ require_once('include/crypto.php');
require_once('include/items.php');
require_once('include/taxonomy.php');
require_once('include/conversation.php');
-require_once('include/zot.php');
/**
* remote post
diff --git a/Zotlabs/Module/Settings.php b/Zotlabs/Module/Settings.php
index 79031c98f..624cbb0c1 100644
--- a/Zotlabs/Module/Settings.php
+++ b/Zotlabs/Module/Settings.php
@@ -1,7 +1,6 @@
<?php
namespace Zotlabs\Module; /** @file */
-require_once('include/zot.php');
require_once('include/security.php');
class Settings extends \Zotlabs\Web\Controller {
@@ -11,68 +10,68 @@ class Settings extends \Zotlabs\Web\Controller {
function init() {
if(! local_channel())
return;
-
+
if($_SESSION['delegate'])
return;
-
+
\App::$profile_uid = local_channel();
-
+
// default is channel settings in the absence of other arguments
-
+
if(argc() == 1) {
// We are setting these values - don't use the argc(), argv() functions here
\App::$argc = 2;
\App::$argv[] = 'channel';
- }
+ }
$this->sm = new \Zotlabs\Web\SubModule();
}
-
-
+
+
function post() {
-
+
if(! local_channel())
return;
-
+
if($_SESSION['delegate'])
return;
-
+
// logger('mod_settings: ' . print_r($_REQUEST,true));
-
+
if(argc() > 1) {
if($this->sm->call('post') !== false) {
return;
}
}
-
+
goaway(z_root() . '/settings' );
return; // NOTREACHED
}
-
-
-
+
+
+
function get() {
-
+
nav_set_selected('Settings');
-
+
if((! local_channel()) || ($_SESSION['delegate'])) {
notice( t('Permission denied.') . EOL );
return login();
}
-
-
+
+
$channel = \App::get_channel();
if($channel)
head_set_icon($channel['xchan_photo_s']);
-
+
$o = $this->sm->call('get');
if($o !== false)
return $o;
$o = '';
-
- }
+
+ }
}
diff --git a/Zotlabs/Module/Wfinger.php b/Zotlabs/Module/Wfinger.php
index 46da7f007..6dedc1ef1 100644
--- a/Zotlabs/Module/Wfinger.php
+++ b/Zotlabs/Module/Wfinger.php
@@ -1,8 +1,6 @@
<?php
namespace Zotlabs\Module;
-require_once('include/zot.php');
-
use Zotlabs\Lib\Keyutils;
use Zotlabs\Lib\Libzot;
@@ -21,7 +19,7 @@ class Wfinger extends \Zotlabs\Web\Controller {
elseif(x($_SERVER,'SERVER_PORT') && (intval($_SERVER['SERVER_PORT']) == 443))
$scheme = 'https';
elseif(x($_SERVER,'HTTP_X_FORWARDED_PROTO') && ($_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https'))
- $scheme = 'https';
+ $scheme = 'https';
$zot = intval($_REQUEST['zot']);
@@ -69,7 +67,7 @@ class Wfinger extends \Zotlabs\Web\Controller {
$channel = substr($channel,1);
$channel = substr($channel,0,-1);
$pchan = true;
- $r = q("select * from pchan left join xchan on pchan_hash = xchan_hash
+ $r = q("select * from pchan left join xchan on pchan_hash = xchan_hash
where pchan_guid = '%s' limit 1",
dbesc($channel)
);
@@ -78,7 +76,7 @@ class Wfinger extends \Zotlabs\Web\Controller {
}
}
else {
- $r = q("select * from channel left join xchan on channel_hash = xchan_hash
+ $r = q("select * from channel left join xchan on channel_hash = xchan_hash
where channel_address = '%s' limit 1",
dbesc($channel)
);
diff --git a/include/bbcode.php b/include/bbcode.php
index 5873d5e68..a362e9ce9 100644
--- a/include/bbcode.php
+++ b/include/bbcode.php
@@ -9,7 +9,6 @@ use Zotlabs\Lib\Libzot;
require_once('include/oembed.php');
require_once('include/event.php');
-require_once('include/zot.php');
require_once('include/html2plain.php');
function get_bb_tag_pos($s, $name, $occurance = 1) {
diff --git a/include/channel.php b/include/channel.php
index e02467125..e44fa01f2 100644
--- a/include/channel.php
+++ b/include/channel.php
@@ -16,7 +16,6 @@ use Zotlabs\Lib\Libzot;
use Zotlabs\Lib\Connect;
use Zotlabs\Lib\Libsync;
-require_once('include/zot.php');
require_once('include/crypto.php');
require_once('include/menu.php');
require_once('include/perm_upgrade.php');
diff --git a/util/fresh b/util/fresh
index 0482d1215..173bdf2af 100755
--- a/util/fresh
+++ b/util/fresh
@@ -4,7 +4,6 @@
// Red cli interpreter
require_once('include/cli_startup.php');
-require_once('include/zot.php');
cli_startup();
@@ -23,7 +22,7 @@ function fresh_main($argc,$argv) {
$line = fgets(STDIN);
}
-
+
if($line === FALSE) {
if(feof(STDIN)) {
break;
@@ -34,7 +33,7 @@ function fresh_main($argc,$argv) {
$line = trim($line);
if($line == 'quit' || $line == 'exit')
exit();
-
+
process_command($line);
}
@@ -62,7 +61,7 @@ function process_command($line) {
case '?':
case 'help':
fresh_help();
- break;
+ break;
case 'finger':
if(argv(1)) {
@@ -92,13 +91,13 @@ function process_command($line) {
echo 'logged in';
$channel = App::get_channel();
if($channel)
- echo ' as ' . $channel['channel_name'];
+ echo ' as ' . $channel['channel_name'];
}
else
echo 'login failed.';
}
- break;
+ break;
case 'channel':
if(! local_channel())
echo 'Permission denied.';
@@ -115,19 +114,19 @@ function process_command($line) {
else
echo 'Channel not found.';
}
- break;
+ break;
case 'conn':
if(! local_channel()) {
echo "Permission denied.";
break;
}
if(argc() > 1) {
- for($x = 1; $x < argc(); $x ++) {
+ for($x = 1; $x < argc(); $x ++) {
$r = q("select * from abook left join xchan on abook_xchan = xchan_hash where abook_id = %d and abook_channel = %d",
intval(argv($x)),
intval(local_channel())
);
- if($r) echo jindent(json_encode($r[0])) . "\n";
+ if($r) echo jindent(json_encode($r[0])) . "\n";
}
}
else {
@@ -144,12 +143,12 @@ function process_command($line) {
default:
break;
- }
+ }
}
-
+
function fresh_help() {
if(argc() == 1) {
@@ -161,4 +160,4 @@ function fresh_help() {
echo "quit|exit - terminate fresh\n";
}
-} \ No newline at end of file
+}
diff --git a/util/pconfig b/util/pconfig
index c2027adaf..13fd1e99b 100755
--- a/util/pconfig
+++ b/util/pconfig
@@ -14,7 +14,6 @@ if(!file_exists('include/cli_startup.php')) {
require_once('include/cli_startup.php');
-require_once('include/zot.php');
cli_startup();
@@ -36,7 +35,7 @@ Usage: util/pconfig
Displays all of the the channel's config entries
util/pconfig <channel_id> <family>
- Displays all of the channel's config entries for the specified family
+ Displays all of the channel's config entries for the specified family
(system, database, etc)
util/pconfig <channel_id> <family> <key>