mirror of
https://framagit.org/hubzilla/core.git
synced 2026-06-21 00:52:33 -04:00
remove zot includes
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -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 */
|
||||
|
||||
@@ -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');
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 = '';
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -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)
|
||||
);
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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');
|
||||
|
||||
23
util/fresh
23
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";
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user