Merge branch 'dev' of /home/macgirvin/z into dev

This commit is contained in:
nobody 2021-06-21 00:38:33 -07:00
commit 41f1159adc
67 changed files with 40222 additions and 8729 deletions

View file

@ -1,6 +1,4 @@
Roadhouse
=========
A fediverse server.
A fediverse server.

View file

@ -436,7 +436,7 @@ class Notifier {
self::$packet_type = 'response';
$is_moderated = their_perms_contains($parent_item['uid'],$sendto,'moderated');
if ($relay_to_owner && $thread_is_public && (! $is_moderated)) {
if (get_pconfig($target_item['uid'],'system','hyperdrive',false)) {
if (get_pconfig($target_item['uid'],'system','hyperdrive',true)) {
Run::Summon([ 'Notifier' , 'hyper', $item_id ]);
}
}

View file

@ -24,10 +24,24 @@ class Activity {
static $ACTOR_CACHE_DAYS = 3;
// $x (string|array)
// if json string, decode it
// returns activitystreams object as an array except if it is a URL
// which returns the URL as string
static function encode_object($x) {
if (($x) && (! is_array($x)) && (substr(trim($x),0,1)) === "{" ) {
$x = json_decode($x,true);
if ($x) {
if (is_string($x)) {
$tmp = json_decode($x,true);
if ($tmp !== NULL) {
$x = $tmp;
}
}
}
if (is_string($x)) {
return ($x);
}
if ($x['type'] === ACTIVITY_OBJ_PERSON) {
@ -776,7 +790,7 @@ class Activity {
$ret['context'] = $cnv;
$ret['conversation'] = $cnv;
}
if (intval($i['item_private']) === 2) {
$ret['directMessage'] = true;
}
@ -792,7 +806,10 @@ class Activity {
if ($replyto) {
$ret['replyTo'] = $replyto;
}
if (! isset($ret['url'])) {
$urls = [];
if (intval($i['item_wall'])) {
@ -839,8 +856,11 @@ class Activity {
if ($i['obj']) {
if (! is_array($i['obj'])) {
$i['obj'] = json_decode($i['obj'],true);
if (is_string($i['obj'])) {
$tmp = json_decode($i['obj'],true);
if ($tmp !== NULL) {
$i['obj'] = $tmp;
}
}
$obj = self::encode_object($i['obj']);
if ($obj)
@ -850,15 +870,20 @@ class Activity {
}
else {
$obj = self::encode_item($i,$activitypub);
if ($obj)
if ($obj) {
$ret['object'] = $obj;
else
}
else {
return [];
}
}
if ($i['target']) {
if (! is_array($i['target'])) {
$i['target'] = json_decode($i['target'],true);
if (is_string($i['target'])) {
$tmp = json_decode($i['target'],true);
if ($tmp !== NULL) {
$i['target'] = $tmp;
}
}
$tgt = self::encode_object($i['target']);
if ($tgt) {
@ -1020,15 +1045,20 @@ class Activity {
return $ret;
}
if (isset($i['obj'])) {
if (is_array($i['obj'])) {
$ret = $i['obj'];
if (isset($i['obj']) && $i['obj']) {
if (is_string($i['obj'])) {
$tmp = json_decode($i['obj'],true);
if ($tmp !== NULL) {
$i['obj'] = $tmp;
}
}
else {
$ret = json_decode($i['obj'],true);
$ret = $i['obj'];
if (is_string($ret)) {
return $ret;
}
}
$ret['type'] = $objtype;
if ($objtype === 'Question') {
@ -1052,6 +1082,16 @@ class Activity {
$ret['id'] = $i['mid'];
$token = IConfig::get($i,'ocap','relay');
if ($token) {
if (defined('USE_BEARCAPS')) {
$ret['id'] = 'bear:?u=' . $ret['id'] . '&t=' . $token;
}
else {
$ret['id'] = $ret['id'] . '?token=' . $token;
}
}
$ret['published'] = datetime_convert('UTC','UTC',$i['created'],ATOM_TIME);
if ($i['created'] !== $i['edited']) {
$ret['updated'] = datetime_convert('UTC','UTC',$i['edited'],ATOM_TIME);
@ -2814,7 +2854,7 @@ class Activity {
if ($act->obj['type'] === 'Note' && $s['attach']) {
if ($act->obj['type'] === 'Note' && isset($s['attach']) && $s['attach']) {
$s['body'] .= self::bb_attach($s['attach'],$s['body']);
}
@ -3298,6 +3338,11 @@ class Activity {
}
}
else {
// By default if we allow you to send_stream and comments and this is a comment, it is allowed.
// A side effect of this action is that if you take away send_stream permission, comments to those
// posts you previously allowed will still be accepted. It is possible but might be difficult to fix this.
$allowed = true;
// reject public stream comments that weren't sent by the conversation owner
@ -3517,6 +3562,12 @@ class Activity {
$x = item_store($item);
}
// experimental code that needs more work. What this did was once we fetched a conversation to find the root node,
// start at that root node and fetch children so you get all the branches and not just the branch related to the current node.
// Unfortunately there is no standard method for achieving this. Mastodon provides a 'replies' collection and Nomad projects
// can fetch the 'context'. For other platforms it's a wild guess. Additionally when we tested this, it started an infinite
// recursion and has been disabled until the recursive behaviour is tracked down and fixed.
// if ($fetch_parents && $parent && ! intval($parent[0]['item_private'])) {
// logger('topfetch', LOGGER_DEBUG);
// // if the thread owner is a connnection, we will already receive any additional comments to their posts
@ -3666,16 +3717,13 @@ class Activity {
}
// This function is designed to work with both ActivityPub and Zot attachments.
// The 'type' of each is different ('Image' vs 'image/jpeg' for example).
// If editing this function please be aware of the need to support both formats
// which we accomplish here through the use of stripos().
// This function is designed to work with Zot attachments and item body
static function bb_attach($attach,$body) {
$ret = false;
if (! $attach) {
if (! (is_array($attach) && $attach)) {
return EMPTY_STR;
}
@ -3710,13 +3758,21 @@ class Activity {
// check for the existence of existing media link in body
static function media_not_in_body($s,$body) {
$s_alt = htmlspecialchars($s, ENT_QUOTES, 'UTF-8');
if ((strpos($body,']' . $s . '[/img]') === false) &&
(strpos($body,']' . $s . '[/zmg]') === false) &&
(strpos($body,']' . $s . '[/video]') === false) &&
(strpos($body,']' . $s . '[/zvideo]') === false) &&
(strpos($body,']' . $s . '[/audio]') === false) &&
(strpos($body,']' . $s . '[/zaudio]') === false)) {
(strpos($body,']' . $s . '[/zaudio]') === false) &&
(strpos($body,']' . $s_alt . '[/img]') === false) &&
(strpos($body,']' . $s_alt . '[/zmg]') === false) &&
(strpos($body,']' . $s_alt . '[/video]') === false) &&
(strpos($body,']' . $s_alt . '[/zvideo]') === false) &&
(strpos($body,']' . $s_alt . '[/audio]') === false) &&
(strpos($body,']' . $s_alt . '[/zaudio]') === false)) {
return true;
}
return false;

View file

@ -101,18 +101,18 @@ class ActivityPub {
return;
}
$token = IConfig::get($target_item['id'],'ocap','relay');
if ($token) {
if (defined('USE_BEARCAPS')) {
$ti['id'] = 'bear:?u=' . $ti['id'] . '&t=' . $token;
}
else {
$ti['id'] = $ti['id'] . '?token=' . $token;
}
if ($ti['url'] && is_string($ti['url'])) {
$ti['url'] .= '?token=' . $token;
}
}
// $token = IConfig::get($target_item['id'],'ocap','relay');
// if ($token) {
// if (defined('USE_BEARCAPS')) {
// $ti['id'] = 'bear:?u=' . $ti['id'] . '&t=' . $token;
// }
// else {
// $ti['id'] = $ti['id'] . '?token=' . $token;
// }
// if ($ti['url'] && is_string($ti['url'])) {
// $ti['url'] .= '?token=' . $token;
// }
// }
$msg = array_merge(['@context' => [
ACTIVITYSTREAMS_JSONLD_REV,

View file

@ -94,14 +94,13 @@ class Libzot {
* @param array $channel
* sender channel structure
* @param string $type
* packet type: one of 'ping', 'pickup', 'purge', 'refresh', 'keychange', 'force_refresh', 'notify', 'auth_check'
* packet type: one of 'activity', 'response', 'sync', 'purge', 'refresh', 'force_refresh', 'rekey'
* @param array $recipients
* envelope recipients, array of portable_id's; empty for public posts
* @param string msg
* optional message
* @param string $remote_key
* optional public site key of target hub used to encrypt entire packet
* NOTE: remote_key and encrypted packets are required for 'auth_check' packets, optional for all others
* @param string $methods
* optional comma separated list of encryption methods @ref self::best_algorithm()
* @returns string json encoded zot packet
@ -153,7 +152,19 @@ class Libzot {
* @param string $methods
* comma separated list of encryption methods
* @return string first match from our site method preferences crypto_methods() array
* of a method which is common to both sites; or 'aes256cbc' if no matches are found.
* of a method which is common to both sites; or an empty string if no matches are found.
*
* Failure to find a common algorithm is not an issue as our communications
* take place primarily over https, so this is just redundant encryption in many cases.
*
* In any case, the receiver is free to reject unencrypted private content if they have
* reason to distrust https.
*
* We are not using array_intersect() here because the specification for that function
* does not guarantee the order of results. It probably returns entries in the correct
* order for our needs and would simplify this function dramatically, but we cannot be
* certain that it will always do so on all operating systems.
*
*/
static function best_algorithm($methods) {
@ -177,8 +188,10 @@ class Libzot {
}
if ($methods) {
// $x = their methods as an array
$x = explode(',', $methods);
if ($x) {
// $y = our methods as an array
$y = Crypto::methods();
if ($y) {
foreach ($y as $yv) {
@ -191,7 +204,7 @@ class Libzot {
}
}
return '';
return EMPTY_STR;
}
@ -240,15 +253,18 @@ class Libzot {
*
* Friending in zot is accomplished by sending a refresh packet to a specific channel which indicates a
* permission change has been made by the sender which affects the target channel. The hub controlling
* the target channel does targetted discovery (a zot-finger request requesting permissions for the local
* channel). These are decoded here, and if necessary and abook structure (addressbook) is created to store
* the permissions assigned to this channel.
* the target channel does targeted discovery (in which a zot discovery request contains permissions for
* the sender which were set by the local channel). These are decoded here, and if necessary an abook
* structure (addressbook) is created to store the permissions assigned to this channel.
*
* Initially these abook structures are created with a 'pending' flag, so that no reverse permissions are
* implied until this is approved by the owner channel. A channel can also auto-populate permissions in
* return and send back a refresh packet of its own. This is used by forum and group communication channels
* so that friending and membership in the channel's "club" is automatic.
*
* If $force is set when calling this function, this operation will be attempted even if our records indicate
* the remote site is permanently down.
*
* @param array $them => xchan structure of sender
* @param array $channel => local channel structure of target recipient, required for "friending" operations
* @param array $force (optional) default false
@ -274,27 +290,21 @@ class Libzot {
}
else {
$r = null;
// if they re-installed the server we could end up with the wrong record - pointing to the old install.
// We'll order by reverse id to try and pick off the newest one first and hopefully end up with the
// correct hubloc. If this doesn't work we may have to re-write this section to try them all.
// if(array_key_exists('xchan_addr',$them) && $them['xchan_addr']) {
// $r = q("select hubloc_id_url, hubloc_primary from hubloc where hubloc_addr = '%s' and hubloc_network = 'zot6' order by hubloc_id desc",
// dbesc($them['xchan_addr'])
// );
// }
// if (! $r) {
$r = q("select hubloc_id_url, hubloc_primary from hubloc where hubloc_hash = '%s' and hubloc_network = 'zot6' order by hubloc_id desc",
dbesc($them['xchan_hash'])
);
// }
// if they re-installed the server we could end up with the wrong record - pointing to a hash generated by the old install.
// We'll order by reverse id to try and pick off the most recently created ones first and hopefully end up with the correct hubloc.
// We are looking for the most recently created primary hub, and the most recently created if for some reason we do not have a primary.
// hubloc_id_url is set to the channel home, which corresponds to an ActivityStreams actor id.
$r = q("select hubloc_id_url, hubloc_primary from hubloc where hubloc_hash = '%s' and hubloc_network = 'zot6' order by hubloc_id desc",
dbesc($them['xchan_hash'])
);
if ($r) {
foreach ($r as $rr) {
if (intval($rr['hubloc_primary'])) {
$url = $rr['hubloc_id_url'];
$record = $rr;
break;
}
}
if (! $url) {
@ -302,6 +312,7 @@ class Libzot {
}
}
}
if (! $url) {
logger('zot_refresh: no url');
return false;
@ -334,6 +345,9 @@ class Libzot {
return false;
}
// If we reach this point, the signature is valid and we can trust the channel discovery data, so try and store
// the generic information in the returned discovery packet.
logger('zot-info: ' . print_r($record,true), LOGGER_DATA, LOG_DEBUG);
$x = self::import_xchan($record['data'], (($force) ? UPDATE_FLAGS_FORCED : UPDATE_FLAGS_UPDATED));
@ -342,6 +356,9 @@ class Libzot {
return false;
}
// Here we handle discovery packets that return targeted permissions and require an abook (either an existing connection
// or a new one)
if ($channel && $record['data']['permissions']) {
$old_read_stream_perm = their_perms_contains($channel['channel_id'],$x['hash'],'view_stream');
set_abconfig($channel['channel_id'],$x['hash'],'system','their_perms',$record['data']['permissions']);
@ -1642,7 +1659,7 @@ class Libzot {
$result = [];
//logger('msg_arr: ' . print_r($msg_arr,true),LOGGER_ALL);
// logger('msg_arr: ' . print_r($msg_arr,true),LOGGER_ALL);
// If an upstream hop used ActivityPub, set the identities to zot6 nomadic identities where applicable
// else things could easily get confused
@ -1671,6 +1688,12 @@ class Libzot {
// if any further changes are to be made, change a copy and not the original
$arr = $msg_arr;
// if (! $msg_arr['mid']) {
// logger('no mid2: ' . print_r($msg_arr,true));
// logger('recip: ' . $d);
// }
$DR = new DReport(z_root(),$sender,$d,$arr['mid']);
$channel = channelx_by_hash($d);
@ -1860,7 +1883,7 @@ class Libzot {
// doesn't exist.
if ($perm === 'send_stream') {
if (get_pconfig($channel['channel_id'],'system','hyperdrive',false)) {
if (get_pconfig($channel['channel_id'],'system','hyperdrive',true)) {
$allowed = true;
}
}
@ -1896,16 +1919,33 @@ class Libzot {
// this is so that permissions mismatches between senders apply to the entire conversation
// As a side effect we will also do a preliminary check that we have the top-level-post, otherwise
// processing it is pointless.
// The original author won't have a token in their copy of the message
$prnt = ((strpos($arr['parent_mid'],'token=') !== false) ? substr($arr['parent_mid'],0,strpos($arr['parent_mid'],'?')) : '');
$r = q("select route, id, parent_mid, mid, owner_xchan, item_private, obj_type from item where mid = '%s' and uid = %d limit 1",
dbesc($arr['parent_mid']),
intval($channel['channel_id'])
);
if (! $r) {
$r = q("select route, id, parent_mid, mid, owner_xchan, item_private, obj_type from item where mid = '%s' and uid = %d limit 1",
dbesc($prnt),
intval($channel['channel_id'])
);
}
if ($r) {
// if this is a multi-threaded conversation, preserve the threading information
if ($r[0]['parent_mid'] !== $r[0]['mid']) {
$arr['thr_parent'] = $arr['parent_mid'];
$arr['parent_mid'] = $r[0]['parent_mid'];
if ($act->replyto) {
q("update item set replyto = '%s' where id = %d",
dbesc($act->replyto),
intval($r[0]['id'])
);
}
}
if ($r[0]['obj_type'] === 'Question') {

View file

@ -52,7 +52,7 @@ class System {
static public function get_update_version() {
if(is_array(App::$config) && is_array(App::$config['system']) && App::$config['system']['hide_version'])
return '';
return EMPTY_STR;
return DB_UPDATE_VERSION;
}
@ -64,7 +64,7 @@ class System {
}
static public function get_site_icon() {
if(is_array(App::$config) && is_array(App::$config['system']) && App::$config['system']['site_icon_url'])
if(is_array(App::$config) && is_array(App::$config['system']) && isset(App::$config['system']['site_icon_url']) && App::$config['system']['site_icon_url'])
return App::$config['system']['site_icon_url'];
return self::get_project_icon();
}
@ -87,10 +87,6 @@ class System {
return 'https://codeberg.org/zot/' . PLATFORM_NAME;
}
static public function get_server_role() {
return 'pro';
}
static public function ebs() {
if(defined('EBSSTATE')) {
return EBSSTATE;
@ -112,7 +108,7 @@ class System {
static public function compatible_project($p) {
if (in_array(strtolower($p),['hubzilla','zap','red','misty','mistpark','redmatrix','osada', 'roadhouse'])) {
if (in_array(strtolower($p),['hubzilla', 'zap', 'red', 'misty', 'mistpark', 'redmatrix', 'osada', 'roadhouse'])) {
return true;
}
return false;

View file

@ -176,7 +176,24 @@ class Activity extends Controller {
);
}
if(! $i) {
$bear = Activity::token_from_request();
if ($bear) {
logger('bear: ' . $bear, LOGGER_DEBUG);
if (! $i) {
$t = q("select * from iconfig where cat = 'ocap' and k = 'relay' and v = '%s'",
dbesc($bear)
);
if ($t) {
$i = q("select id as item_id from item where uuid = '%s' and id = %d $item_normal limit 1",
dbesc($item_id),
intval($t[0]['iid'])
);
}
}
}
if (! $i) {
http_status_exit(403,'Forbidden');
}

View file

@ -6,11 +6,6 @@ use App;
use Zotlabs\Web\Controller;
// This is the primary endpoint for communicating with Zot directory services.
// Additionally the 'sitelist' endpoint may be used to query directory knowledge
// of discovered sites. That endpoint should be merged so that there is one
// definitive endpoint for directory services and since this endpoint already
// performs some site query functions.
class Dirsearch extends Controller {

View file

@ -108,6 +108,22 @@ class Item extends Controller {
);
}
$bear = Activity::token_from_request();
if ($bear) {
logger('bear: ' . $bear, LOGGER_DEBUG);
if (! $i) {
$t = q("select * from iconfig where cat = 'ocap' and k = 'relay' and v = '%s'",
dbesc($bear)
);
if ($t) {
$i = q("select id as item_id from item where uuid = '%s' and id = %d $item_normal limit 1",
dbesc($item_id),
intval($t[0]['iid'])
);
}
}
}
if (! $i) {
http_status_exit(403,'Forbidden');
}
@ -205,6 +221,22 @@ class Item extends Controller {
);
}
$bear = Activity::token_from_request();
if ($bear) {
logger('bear: ' . $bear, LOGGER_DEBUG);
if (! $i) {
$t = q("select * from iconfig where cat = 'ocap' and k = 'relay' and v = '%s'",
dbesc($bear)
);
if ($t) {
$i = q("select id as item_id from item where uuid = '%s' and id = %d $item_normal limit 1",
dbesc($item_id),
intval($t[0]['iid'])
);
}
}
}
if (! $i) {
http_status_exit(403,'Forbidden');
}
@ -908,16 +940,15 @@ class Item extends Controller {
'term' => $ng['xchan_name'],
'url' => $ng['xchan_url']
);
if ($ng['xchan_network'] === 'activitypub') {
$colls = get_xconfig($ng['xchan_hash'],'activitypub','collections');
if ($colls && is_array($colls) && isset($colls['wall'])) {
$datarray['target'] = [
'id' => $colls['wall'],
'type' => 'Collection',
'attributedTo' => $ng['xchan_hash']
];
$datarray['tgt_type'] = 'Collection';
}
$colls = get_xconfig($ng['xchan_hash'],'activitypub','collections');
if ($colls && is_array($colls) && isset($colls['wall'])) {
$datarray['target'] = [
'id' => $colls['wall'],
'type' => 'Collection',
'attributedTo' => (($ng['xchan_network'] === 'zot6') ? $ng['xchan_url'] : $ng['xchan_hash'])
];
$datarray['tgt_type'] = 'Collection';
}
}
}

View file

@ -41,7 +41,7 @@ class Removeme extends Controller {
if ($account['account_password_changed'] > NULL_DATE) {
$d1 = datetime_convert('UTC','UTC','now - 48 hours');
if($account['account_password_changed'] > d1) {
if($account['account_password_changed'] > $d1) {
notice( t('Channel removals are not allowed within 48 hours of changing the account password.') . EOL);
return;
}

View file

@ -42,7 +42,7 @@ class Setup extends Controller {
// throw a white screen because these error messages divulge information which can
// potentially be useful to hackers.
error_reporting(E_ERROR | E_WARNING | E_PARSE );
error_reporting(E_ERROR | E_PARSE );
ini_set('log_errors', '0');
ini_set('display_errors', '1');
@ -283,15 +283,16 @@ class Setup extends Controller {
case 2: { // Database config
$dbhost = ((x($_POST,'dbhost')) ? trim($_POST['dbhost']) : '127.0.0.1');
$dbuser = trim($_POST['dbuser']);
$dbport = intval(trim($_POST['dbport']));
$dbpass = trim($_POST['dbpass']);
$dbdata = trim($_POST['dbdata']);
$dbtype = intval(trim($_POST['dbtype']));
$phpath = trim($_POST['phpath']);
$adminmail = trim($_POST['adminmail']);
$siteurl = trim($_POST['siteurl']);
$servertype = intval(trim($_POST['servertype']));
$dbuser = ((x($_POST,'dbuser')) ? trim($_POST['dbuser']): EMPTY_STR);
$dbport = ((x($_POST,'dbport')) ? intval(trim($_POST['dbport'])) : 0);
$dbpass = ((x($_POST,'dbpass')) ? trim($_POST['dbpass']): EMPTY_STR);
$dbdata = ((x($_POST,'dbdata')) ? trim($_POST['dbdata']): EMPTY_STR);
$dbtype = ((x($_POST,'dbtype')) ? intval(trim($_POST['dbtype'])) : 0);
$phpath = ((x($_POST,'phpath')) ? trim($_POST['phpath']): EMPTY_STR);
$adminmail = ((x($_POST,'adminmail')) ? trim($_POST['adminmail']): EMPTY_STR);
$siteurl = ((x($_POST,'siteurl')) ? trim($_POST['siteurl']): EMPTY_STR);
$servertype = EMPTY_STR;
$tpl = get_markup_template('install_db.tpl');
$o .= replace_macros($tpl, array(
@ -323,18 +324,18 @@ class Setup extends Controller {
return $o;
}; break;
case 3: { // Site settings
require_once('include/datetime.php');
$dbhost = ((x($_POST,'dbhost')) ? trim($_POST['dbhost']) : '127.0.0.1');
$dbport = intval(trim($_POST['dbuser']));
$dbuser = trim($_POST['dbuser']);
$dbpass = trim($_POST['dbpass']);
$dbdata = trim($_POST['dbdata']);
$dbtype = intval(trim($_POST['dbtype']));
$phpath = trim($_POST['phpath']);
$servertype = 0;
$dbuser = ((x($_POST,'dbuser')) ? trim($_POST['dbuser']): EMPTY_STR);
$dbport = ((x($_POST,'dbport')) ? intval(trim($_POST['dbport'])) : 0);
$dbpass = ((x($_POST,'dbpass')) ? trim($_POST['dbpass']): EMPTY_STR);
$dbdata = ((x($_POST,'dbdata')) ? trim($_POST['dbdata']): EMPTY_STR);
$dbtype = ((x($_POST,'dbtype')) ? intval(trim($_POST['dbtype'])) : 0);
$phpath = ((x($_POST,'phpath')) ? trim($_POST['phpath']): EMPTY_STR);
$adminmail = trim($_POST['adminmail']);
$siteurl = trim($_POST['siteurl']);
$servertype = EMPTY_STR;
$adminmail = ((x($_POST,'adminmail')) ? trim($_POST['adminmail']): EMPTY_STR);
$siteurl = ((x($_POST,'siteurl')) ? trim($_POST['siteurl']): EMPTY_STR);
$timezone = ((x($_POST,'timezone')) ? ($_POST['timezone']) : 'America/Los_Angeles');
@ -455,6 +456,7 @@ class Setup extends Controller {
function check_phpconfig(&$checks) {
$help = '';
$mem_warning = EMPTY_STR;
$result = self::getPhpiniUploadLimits();
if($result['post_max_size'] < (2 * 1024 * 1024) || $result['max_upload_filesize'] < (2 * 1024 * 1024)) {
@ -849,6 +851,8 @@ class Setup extends Controller {
static private function phpiniSizeToBytes($val) {
$val = trim($val);
$unit = strtolower($val[strlen($val)-1]);
// strip off any non-numeric portion
$val = intval($val);
switch($unit) {
case 'g':
$val *= 1024;

View file

@ -1,66 +0,0 @@
<?php
namespace Zotlabs\Module;
use Zotlabs\Web\Controller;
class Sitelist extends Controller {
function init() {
$start = (($_REQUEST['start']) ? intval($_REQUEST['start']) : 0);
$limit = ((intval($_REQUEST['limit'])) ? intval($_REQUEST['limit']) : 30);
$order = (($_REQUEST['order']) ? $_REQUEST['order'] : 'random');
$open = (($_REQUEST['open']) ? intval($_REQUEST['open']) : false);
$sql_order = " order by site_url ";
$rand = db_getfunc('rand');
if ($order == 'random') {
$sql_order = " order by $rand ";
}
$sql_limit = " LIMIT $limit OFFSET $start ";
$sql_extra = "";
if ($open) {
// only return sites with open registration
$sql_extra = " and site_register = " . intval(REGISTER_OPEN) . " ";
}
$result = [ 'success' => false ];
$r = q("select count(site_url) as total from site where site_type = %d and site_dead = 0 $sql_extra ",
intval(SITE_TYPE_ZOT)
);
if ($r) {
$result['total'] = intval($r[0]['total']);
}
$result['start'] = $start;
$result['limit'] = $limit;
$r = q("select * from site where site_type = %d and site_dead = 0 $sql_extra $sql_order $sql_limit",
intval(SITE_TYPE_ZOT)
);
$result['results'] = 0;
$result['entries'] = [];
if($r) {
$result['success'] = true;
$result['results'] = count($r);
foreach ($r as $rv) {
$result['entries'][] = [ 'url' => $rv['site_url'] ];
}
}
json_return_and_die($result);
}
}

View file

@ -4,9 +4,9 @@ namespace Zotlabs\Update;
class _1181 {
function run() {
if(\Zotlabs\Lib\System::get_server_role() == 'pro') {
q("update account set account_level = 5 where true");
}
// if(\Zotlabs\Lib\System::get_server_role() == 'pro') {
// q("update account set account_level = 5 where true");
// }
return UPDATE_SUCCESS;
}

View file

@ -75,13 +75,13 @@ class Settings_menu {
'selected' => ''
);
if(feature_enabled(local_channel(),'oauth_clients')) {
$tabs[] = array(
'label' => t('OAuth1 apps'),
'url' => z_root() . '/settings/oauth',
'selected' => ((argv(1) === 'oauth') ? 'active' : ''),
);
}
// if(feature_enabled(local_channel(),'oauth_clients')) {
// $tabs[] = array(
// 'label' => t('OAuth1 apps'),
// 'url' => z_root() . '/settings/oauth',
// 'selected' => ((argv(1) === 'oauth') ? 'active' : ''),
// );
// }
if(Apps::system_app_installed(local_channel(),'Clients')) {
$tabs[] = array(
@ -91,38 +91,38 @@ class Settings_menu {
);
}
if(feature_enabled(local_channel(),'access_tokens')) {
$tabs[] = array(
'label' => t('Guest Access Tokens'),
'url' => z_root() . '/settings/tokens',
'selected' => ((argv(1) === 'tokens') ? 'active' : ''),
);
}
// if(feature_enabled(local_channel(),'access_tokens')) {
// $tabs[] = array(
// 'label' => t('Guest Access Tokens'),
// 'url' => z_root() . '/settings/tokens',
// 'selected' => ((argv(1) === 'tokens') ? 'active' : ''),
// );
// }
if(feature_enabled(local_channel(),'permcats')) {
$tabs[] = array(
'label' => t('Permission Categories'),
'url' => z_root() . '/settings/permcats',
'selected' => ((argv(1) === 'permcats') ? 'active' : ''),
);
}
// if(feature_enabled(local_channel(),'permcats')) {
// $tabs[] = array(
// 'label' => t('Permission Categories'),
// 'url' => z_root() . '/settings/permcats',
// 'selected' => ((argv(1) === 'permcats') ? 'active' : ''),
// );
// }
if($role === false || $role === 'custom') {
$tabs[] = array(
'label' => t('Connection Default Permissions'),
'url' => z_root() . '/defperms',
'selected' => ''
);
}
// if($role === false || $role === 'custom') {
// $tabs[] = array(
// 'label' => t('Connection Default Permissions'),
// 'url' => z_root() . '/defperms',
// 'selected' => ''
// );
// }
if(feature_enabled(local_channel(),'channel_sources')) {
$tabs[] = array(
'label' => t('Channel Sources'),
'url' => z_root() . '/sources',
'selected' => ''
);
}
// if(feature_enabled(local_channel(),'channel_sources')) {
// $tabs[] = array(
// 'label' => t('Channel Sources'),
// 'url' => z_root() . '/sources',
// 'selected' => ''
// );
// }
$tabtpl = get_markup_template("generic_links_widget.tpl");
return replace_macros($tabtpl, array(

View file

@ -17,7 +17,7 @@ use Zotlabs\Daemon\Run;
* @brief This file defines some global constants and includes the central App class.
*/
define ( 'STD_VERSION', '21.06.12' );
define ( 'STD_VERSION', '21.06.20' );
define ( 'NOMAD_REVISION', '10.0' );
define ( 'DB_UPDATE_VERSION', 1248 );
@ -639,8 +639,6 @@ function sys_boot() {
App::$config['system']['timezone'] = $default_timezone;
}
App::$config['system']['server_role'] = 'pro';
App::$timezone = (isset(App::$config['system']['timezone']) ? App::$config['system']['timezone'] : 'UTC');
date_default_timezone_set(App::$timezone);
@ -1127,7 +1125,7 @@ class App {
}
if (! x(self::$page,'title')) {
self::$page['title'] = self::$config['system']['sitename'];
self::$page['title'] = ((array_path_exists('system/sitename',self::$config)) ? self::$config['system']['sitename'] : EMPTY_STR);
}
if (! self::$meta->get_field('og:title')) {
@ -1157,6 +1155,10 @@ class App {
* being first
*/
if (! isset(self::$page['htmlhead'])) {
self::$page['htmlhead'] = EMPTY_STR; // needed to silence warning
}
self::$page['htmlhead'] = replace_macros(get_markup_template('head.tpl'),
[
'$preload_images' => $preload_images,
@ -2369,7 +2371,7 @@ function head_set_icon($icon) {
*/
function head_get_icon() {
$icon = App::$data['pageicon'];
$icon = ((isset(App::$data['pageicon'])) ? App::$data['pageicon'] : EMPTY_STR);
if($icon && ! strpos($icon, '://'))
$icon = z_root() . $icon;

401
composer.lock generated

File diff suppressed because it is too large Load diff

259
doc/develop/en/comanche.mc Normal file
View file

@ -0,0 +1,259 @@
[b]Comanche Page Description Language -- Advanced (for developers)[/b]
Comanche is a markup language similar to bbcode with which to create elaborate and complex web pages by assembling them from a series of components - some of which are pre-built and others which can be defined on the fly. Comanche uses a Page Decription Language to create these pages.
Comanche primarily chooses what content will appear in various regions of the page. The various regions have names and these names can change depending on what layout template you choose.
[b]Page Templates[/b]
Currently there are five layout templates, unless your site provides additional layouts.
[code]
[b]default[/b]
The default template defines a &quot;nav&quot; region across the top, &quot;aside&quot; as a fixed width sidebar,
&quot;content&quot; for the main content region, and &quot;footer&quot; for a page footer.
[b]full[/b]
The full template defines the same as the default template with the exception that there is no &quot;aside&quot; region.
[b]choklet[/b]
The choklet template provides a number of fluid layout styles which can be specified by flavour:
(default flavour) - a two column layout similar to the "default" template, but more fluid
bannertwo - a two column layout with a banner region, compatible with the "default" template on small displays
three - three column layout (adds a "right_aside" region to the default template)
edgestwo - two column layout with fixed side margins
edgesthree - three column layout with fixed side margins
full - three column layout with fixed side margins and adds a "header" region beneath the navigation bar
[b]redable[/b] (sic)
A template for reading longer texts full screen (so without navigation bar). Three columns: aside, content and right_aside.
For maximum readability it is advised to only use the middle content column.
[b]zen[/b]
Gives you the freedom to do everything yourself. Just a blank page with a content region.
[/code]
To choose a layout template, use the 'template' tag.
[code]
[template]full[/template]
[/code]
To choose the "choklet" template with the "three" flavour:
[code]
[template=three]choklet[/template]
[/code]
The default template will be used if no other template is specified. The template can use any names it desires for content regions. You will be using 'region' tags to decide what content to place in the respective regions.
Three &quot;macros&quot; have been defined for your use.
[code]
$htmlhead - replaced with the site head content.
$nav - replaced with the site navigation bar content.
$content - replaced with the main page content.
[/code]
By default, $nav is placed in the &quot;nav&quot; page region and $content is placed in the &quot;content&quot; region. You only need to use these macros if you wish to re-arrange where these items appear, either to change the order or to move them to other regions.
To select a theme for your page, use the 'theme' tag.
[code]
[theme]suckerberg[/theme]
[/code]
This will select the theme named &quot;suckerberg&quot;. By default your channel's preferred theme will be used.
[code]
[theme=passion]suckerberg[/theme]
[/code]
This will select the theme named &quot;suckerberg&quot; and select the &quot;passion&quot; schema (theme variant). Alternatively it may be possible to use a condensed theme notation for this.
[code]
[theme]suckerberg:passion[/theme]
[/code]
The condensed notation isn't part of Comanche itself but is recognised by $Projectname platform as a theme specifier.
[b]Regions[/b]
Each region has a name, as noted above. You will specify the region of interest using a 'region' tag, which includes the name. Any content you wish placed in this region should be placed between the opening region tag and the closing tag.
[code]
[region=htmlhead]....content goes here....[/region]
[region=aside]....content goes here....[/region]
[region=nav]....content goes here....[/region]
[region=content]....content goes here....[/region]
[/code]
[b]CSS and Javascript[/b]
We have the possibility to include javascript and css libraries in the htmlhead region. At present we make use of jquery (js), bootstrap (css/js) and foundation (css/js).
This will overwrite the selected themes htmlhead.
[code]
[region=htmlhead]
[css]bootstrap[/css]
[js]jquery[/js]
[js]bootstrap[/js]
[/region]
[/code]
[b]Menus and Blocks[/b]
Your webpage creation tools allow you to create menus and blocks, in addition to page content. These provide a chunk of existing content to be placed in whatever regions and whatever order you specify. Each of these has a name which you define when the menu or block is created.
[code]
[menu]mymenu[/menu]
[/code]
This places the menu called &quot;mymenu&quot; at this location on the page, which must be inside a region.
[code]
[menu=horizontal]mymenu[/menu]
[/code]
This places the menu called &quot;mymenu&quot; at this location on the page, which must be inside a region. Additionally it applies the "horizontal" class to the menu. "horizontal" is defined in the redbasic theme. It may or may not be available in other themes.
[code]
[menu][var=wrap]none[/var]mymenu[/menu]
[/code]
The variable [var=wrap]none[/var] in a block removes the wrapping div element from the menu.
[code]
[block]contributors[/block]
[/code]
This places a block named &quot;contributors&quot; in this region.
[code]
[block=someclass]contributors[/block]
[/code]
This places a block named &quot;contributors&quot; in this region. Additionally it applies the &quot;someclass&quot; class to the block. This replaces the default block classes &quot;bblock widget&quot;.
[code]
[block][var=wrap]none[/var]contributors[/block]
[/code]
The variable [var=wrap]none[/var] in a block removes the wrapping div element from the block.
[b]Widgets[/b]
Widgets are executable apps provided by the system which you can place on your page. Some widgets take arguments which allows you to tailor the widget to your purpose. (TODO: list available widgets and arguments). The base system provides
[code]
profile - widget which duplicates the profile sidebar of your channel page. This widget takes no arguments
tagcloud - provides a tag cloud of categories
count - maximum number of category tags to list
[/code]
Widgets and arguments are specified with the 'widget' and 'var' tags.
[code]
[widget=recent_visitors][var=count]24[/var][/widget]
[/code]
This loads the &quot;recent_visitors&quot; widget and supplies it with the argument &quot;count&quot; set to &quot;24&quot;.
[b]Comments[/b]
The 'comment' tag is used to delimit comments. These comments will not appear on the rendered page.
[code]
[comment]This is a comment[/comment]
[/code]
[b]Conditional Execution[/b]
You can use an 'if' construct to make decisions. These are currently based on system configuration variable or the current observer.
[code]
[if $config.system.foo]
... the configuration variable system.foo evaluates to 'true'.
[else]
... the configuration variable system.foo evaluates to 'false'.
[/if]
[if $observer]
... this content will only be show to authenticated viewers
[/if]
[/code]
The 'else' clause is optional.
Several tests are supported besides boolean evaluation.
[code]
[if $config.system.foo == bar]
... the configuration variable system.foo is equal to the string 'bar'
[/if]
[if $config.system.foo != bar]
... the configuration variable system.foo is not equal to the string 'bar'
[/if]
[if $config.system.foo {} bar ]
... the configuration variable system.foo is a simple array containing a value 'bar'
[/if]
[if $config.system.foo {*} bar]
... the configuration variable system.foo is a simple array containing a key named 'bar'
[/if]
[/code]
[b]Complex Example[/b]
[code]
[comment]use an existing page template which provides a banner region plus 3 columns beneath it[/comment]
[template]3-column-with-header[/template]
[comment]Use the &quot;darknight&quot; theme[/comment]
[theme]darkknight[/theme]
[comment]Use the existing site navigation menu[/comment]
[region=nav]$nav[/region]
[region=side]
[comment]Use my chosen menu and a couple of widgets[/comment]
[menu]myfavouritemenu[/menu]
[widget=recent_visitors]
[var=count]24[/var]
[var=names_only]1[/var]
[/widget]
[widget=tagcloud][/widget]
[block]donate[/block]
[/region]
[region=middle]
[comment]Show the normal page content[/comment]
$content
[/region]
[region=right]
[comment]Show my condensed channel &quot;wall&quot; feed and allow interaction if the observer is allowed to interact[/comment]
[widget]channel[/widget]
[/region]
[/code]

222
doc/pl/admin/install.md Normal file
View file

@ -0,0 +1,222 @@
## Instalacja oprogramowania
Bardzo się staraliśmy, aby to oprogramowanie działało na popularnych platformach hostingowych - takich jakie sie używa do hostowania blogów Wordpressa czy witryn opartych na Drupal. $Projectname będzie działać na większości systemów VPS opartych na Linux. Platformy Windows LAMP, takie jak XAMPP i WAMP nie są obecnie oficjalnie obsługiwane - jednak z zadowoleniem przyjmujemy łatki, jeśli uda ci się to uruchomić.
Należy pamiętać, że to oprogramowanie to coś więcej niż prosta aplikacja internetowa. Jest to złożony system komunikacji i zarządzania treścią, który bardziej przypomina serwer poczty internetowej niż serwer WWW. Aby zapewnić niezawodność i wydajność, komunikaty są dostarczane w tle i umieszczane w kolejce do późniejszego dostarczenia, gdy lokacje są niedostępne. Ten rodzaj funkcjonalności wymaga nieco więcej od systemu hosta niż typowy blog. Nie każdy dostawca hostingu PHP/MySQL będzie w stanie spełnić te wymagania. Wielu to zapewnia - ale lepiej jest zapoznać się z wymaganiami i potwierdzić je u dostawcy usług hostingowych jeszcze przed instalacją (a w szczególności przed zawarciem długoterminowej umowy).
Jeśli napotkasz problemy z instalacją, prosimy o informację o tym, za pośrednictwem [systemu śledzenia spraw projektu](https://codeberg.org/zot/zap), skąd pobrałeś oprogramowanie. Podaj jak najwięcej informacji o swoim środowisku operacyjnym i jak najwięcej szczegółów na temat wszelkich komunikatów o błędach, które możesz zobaczyć, abyśmy mogli zapobiec temu w przyszłości. Ze względu na dużą różnorodność działania istniejących systemów i platform PHP, możemy mieć tylko ograniczone możliwości debugowania instalację PHP lub pozyskania brakujących modułów - ale zrobimy to, starając się rozwiązywać ogólne problemy z kodem.
### Zanim zaczniesz
Wybierz nazwę domeny i ewentualnie poddomeny dla swojego serwera.
Oprogramowanie można zainstalować tylko w katalogu głównym domeny lub poddomeny i nie może ono działać na alternatywnych portach TCP.
Wymagane jest szyfrowanie SSL komunikacji z serwerem WWW a stosowany certyfikat SSL musi być "prawidłowy dla przeglądarki". Nie można używać certyfikatów z podpisem własnym!
Przetestuj swój certyfikat przed instalacją. Narzędzie internetowe do testowania certyfikatu jest dostępne pod adresem "http://www.digicert.com/help/". Odwiedzając witrynę po raz pierwszy, użyj adresu URL SSL („https://”). Pozwoli to uniknąć późniejszych problemów.
Bezpłatne certyfikaty zgodne z przeglądarkami są dostępne od dostawców, takich jak StartSSL i LetsEncrypt.
Jeśli stosujesz LetsEncrypt do dostarczania certyfikatów i tworzenia pliku w ramach usługi "well-known" lub "acme-challenge", tak aby LetsEncrypt mógł zweryfikować własność domeny, usuń lub zmień nazwę katalogu `.well-known`, gdy tylko plik
certyfikatu zostanie wygenerowany. Oprogramowanie zapewnia własny program obsługi usługu "well-known", gdy jest instalowany a istnienie tego katalogu podczas dalszego działania serwera może uniemożliwić poprawne działanie niektórych usług. To nie powinno być problemem w Apache, ale może być problemem z nginx lub innym serwerze WWW.
### Instalacja
#### Wymagania
- Apache z włączoną obsługą mod-rewrite i dyrektywą "AllowOverride All", więc możesz użyć lokalnego pliku .htaccess. Niektórzy z powodzeniem używali nginx i lighttpd. Przykładowe skrypty konfiguracyjne są dostępne dla tych platform w katalogu instalacyjnym. Największe wsparcia ma Apache i Nginx.
- PHP 7.2 lub wersja późniejsza (z wersją 8.0 włącznie).
- Dostęp do *wiersza poleceń* PHP z ustawionym na `true` argumentem `register_argc_argv` w pliku php.ini - oraz bez ograniczeń w stosowaniu funkcji exec() i proc_open(), które często nakładają operatorzy hostingu.
- Rozszerzenia curl, gd (z obsługą co najmniej jpeg i png), mysqli, mbstring, xml, xmlreader (FreeBSD), zip i openssl. Zamiast biblioteki gd, można używać rozszerzenia imagick ale nie jest ono wymagane i MOŻE być również wyłączone za pomocą opcji konfiguracyjnej.
- Jakaś forma serwera pocztowego lub bramy poczty elektronicznej na której działa funkcja mail() PHP.
- MySQL 5.5.3 lub w wersji nowszej lub serwer MariaDB lub Postgres. Wyszukiwanie bez rozróżniania wielkości liter nie jest obsługiwane w Postgres. Nie jest to szkodliwe, ale węzły z Postgres raczej nie powinny być używane jako serwery katalogów z powodu tego ograniczenia.
- Możliwość planowania zadań przy użyciu crona.
- Wymagana jest instalacja w głównym katalogu domeny lub poddomeny (bez składnika katalog/ścieżka w adresie URL).
### Procedura instalacyjna
**1. Rozpakuj pliki projektu do katalogu głównego obszaru dokumentów serwera WWW.**
Jeśli kopiujesz drzewo katalogów na swój serwer WWW, upewnij się, że kopiujesz również `.htaccess` - ponieważ pliki "z kropką" są często ukryte i normalnie nie są kopiowane.
Jeśli możesz to zrobić, zalecamy użycie git do sklonowania repozytorium źródłowego, zamiast używania spakowanego pliku tar lub zip. To znacznie ułatwia aktualizację oprogramowania. Polecenie Linuksa do sklonowania repozytorium do katalogu `mywebsite` jest następujące
git clone https://codeberg.org/zot/zap.git mywebsite
cd mywebsite
a następnie w dowolnym momencie możesz pobrać najnowsze zmiany za pomocą polecenia
git pull
Utwórz foldery `cache/smarty3` i `store`, jeśli nie istnieją i upewnij się, że są możliwe do zapisu przez serwer internetowy.
mkdir -p store
mkdir -p cache/smarty3
chmod -R 775 store cache
Tu zakładamy, że katalog instalacyjny $Projectname (lub wirtualnego hosta) jest skonfigurowany tak, że prawa własności ma administrator serwera WWW i grupa do której należy zarówno administrator serwera jak i właściciel procesu serwera WWW. Właściciel procesu serwera WWW (np. www-data) nie musi a nawet nie powinien mieć uprawnień zapisu do pozostałej części instalacji (tylko odczyt).
**2. Zainstaluj dodatki.**
Następnie należy sklonować repozytorium dodatków (osobno). Dla przykładu nadamy temu repozytorium nazwę `zaddons` (w Twoim przypadku może to być inna nazwa, ale uwzglednij to w poleceniach).
cd mywebsite
util/add_addon_repo https://codeberg.org/zot/zap-addons.git zaddons
Aby aktualizować drzewo dodatków trzeba znajdować się w głównym katalogu instalacji $Projectname i wydać polecenie aktualizacji dla tego repozytorium.
cd mywebsite
util/update_addon_repo zaddons
**3. Utwórz pustą bazę danych ustaw uprawnienia dostępu.**
Utwórz pustą bazę danych i zanotuj szczegóły dostępu (nazwa hosta, nazwa użytkownika, hasło, nazwa bazy danych). Biblioteki bazy danych PDO powrócą do komunikacji przez gniazdo, jeśli nazwa hosta to "localhost", ale mogą wystąpić z tym problemy. Użyj tego, jeśli Twoje wymagania na to pozwalają. W przeciwnym razie, jeśli baza danych jest udostępniana na serwerze lokalnym, jako nazwę hosta wpisz "127.0.0.1". Korzystając z MySQL lub MariaDB, ustaw kodowanie znaków bazy danych na utf8mb4, aby uniknąć problemów z kodowaniem za pomocą emoji. Wszystkie tabele wewnętrzne są tworzone z kodowaniem utf8mb4_general_ci, więc jeśli ustawisz kodowania na utf8 a nie na utf8mb4, mogą wystąpić problemy.
Wewnętrznie używamy teraz biblioteki PDO do połączeń z bazami danych. Jeśli napotkasz konfigurację bazy danych, której nie można wyrazić w formularzu konfiguracyjnym (na przykład przy użyciu MySQL z nietypową lokalizacją gniazda), możesz dostarczyć
ciąg połączenia PDO jako nazwę hosta bazy danych. Na przykład:
mysql:unix_socket=/my/special/socket_path
W razie potrzeby nadal należy wypełnić wszystkie inne obowiązujące wartości formularza.
**4. Utwórz pusty plik konfuguracyjnego .htconfig.php**
Jeśli serwer WWW nie będzie mógł dokonywać zapisów do plików innych niż te podane w pkt. 2 (a nie powinien), trzeba ręcznie utworzyć plik o nazwie .htconfig.php (zlokalizowany w katalogu głównym instalacji) i uczynić go zapisywalnym przez serwer internetowy.
**5. Odwiedź swoją witrynę internetową**
Odwiedź swoją witrynę za pomocą przeglądarki internetowej i postępuj zgodnie z instrukcjami. Zanotuj wszelkie komunikaty o błędach i popraw je przed kontynuowaniem. Jeśli korzystasz z protokołu SSL z uznanym certyfikatem, użyj schematu https:// w adresie URL swojej witryny internetowej.
**6. Jeżeli automatyczna instalacja nie powiedzie się.**
Jeżeli automatyczna instalacja nie powiedzie się z jakichś powodów, sprawdź co następuje:
- Czy istnieje ".htconfig.php"? If not, edit htconfig.php and change system settings. Rename to .htconfig.php
- Czy wypełniona została baza danych? Jeśli nie, zaimportuj zawartość pliku "install/schema_xxxxx.sql" w phpmyadmin lub w wierszu poleceń mysql (zamieniając 'xxxxx' na właściwy typ bazy danych).
**7. Zarejestruj swoje osobiste konto.**
W tym momencie ponownie odwiedź swoją witrynę i zarejestruj swoje konto osobiste. Wszystkie błędy rejestracji powinny zostać automatycznie naprawione. Jeśli w tym momencie wystąpi jakakolwiek *krytyczna* awaria, to przeważnie oznacza, że baza danych nie została poprawnie zainstalowana. Możesz przenieść lub zmienić nazwę .htconfig.php na inną nazwę i opróżnić bazę danych, dzięki czemu możesz zacząć instalację od nowa.
Twoje konto jeśli ma mieć dostęp administratorski, powinno być pierwszym utworzonym kontem, a adres e-mail podany podczas rejestracji musi być zgodny z adresem "administratora" podanym podczas instalacji. W przeciwnym razie, aby nadać dostęp administratora do jakiegoś konta, trzeba dodać wartość 4096 w polu account_roles w tabeli account bazy danych.
Ze względu na bezpieczeństwo witryny nie ma możliwości zapewnienia dostępu administratora za pomocą formularzy internetowych.
**8. Ustawienie zadań crona**
Skonfiguruj zadanie crona lub zaplanowane zadanie, aby uruchamiać menedżera crona co 10-15 minut do wykonywania w tle zadań przetwarzania i konserwacji. Przykład:
cd /base/directory; /path/to/php Zotlabs/Daemon/Run.php Cron
Zmień "/base/directory" i "/path/to/php" na swoje rzeczywiste ścieżki.
Jeśli używasz serwera Linux, uruchom "crontab -e" i dodaj linię podobną do pokazanej niżej, zastępując ścieżki i ustawienia swoimi danymi:
*/10 * * * * cd /home/myname/mywebsite; /usr/bin/php Zotlabs/Daemon/Run.php Cron > /dev/null 2>&1
Na ogół możesz znaleźć lokalizację PHP, wykonując "which php". Jeśli masz problemy z tą sekcją, skontaktuj się z dostawcą usług hostingowych w celu uzyskania pomocy. Oprogramowanie nie będzie działać poprawnie, jeśli nie możesz wykonać tego kroku.
Trzeba również upewnić się, że ustawiona jest poprawnie opcja `App::$config['system']['php_path']` w pliku .htconfig.php:
App::$config['system']['php_path'] = '/usr/local/php72/bin/php';
Oczywiście trzeba podać swoją rzeczywistą ścieżkę do katalogu php.
### Jeżeli rzeczy nie działają tak jak powinny
##### Jeśli wyświetla się komunikat "System is currently unavailable. Please try again later"
Sprawdź ustawienia bazy danych. Zwykle oznacza to, że baza danych nie może być otwarte lub dostępne. Jeśli baza danych znajduje się na tym samym komputerze, sprawdź, czy
nazwa serwera bazy danych to "127.0.0.1" lub "localhost".
##### Błąd wewnętrzny 500
Może to być wynikiem braku jednej z wymaganych dyrektyw Apache na Twojej wersji Apache. Sprawdź swoje logi serwera Apache. Sprawdź również swoje uprawnienia do plików. Twoja strona internetowa i wszystkie treści muszą być możliwe do odczytu.
Możliwe, że Twój serwer sieciowy zgłosił źródło problemu w swoich plikach dziennika błędów. Przejrzyj te systemowe dzienniki błędów, aby określić przyczynę problemu. Często będzie to wymagało rozwiązania u dostawcy usług hostingowych lub (w przypadku samodzielnego hostowania) konfiguracji serwera WWW.
##### Błędy 400 i 4xx "File not found"
Najpierw sprawdź swoje uprawnienia do plików. Wszystkie katalogi i pliki portalu i wszystkie treści muszą być możliwe do odczytu przez wszystkich.
Upewnij się, że moduł mod-rewrite jest zainstalowany i działa i używany jest plik .htaccess. Aby zweryfikować to drugie, utwórz plik test.out zawierający słowo "test" w górnym katalogu sieciowym, uczyń go czytelnym dla wszystkich i skieruj przeglądarkę na adres
http://yoursitenamehere.com/test.out
Ten plik powinien być blokowany i powinien zostać wyświetlony komunikat o odmowie dostępu.
Jeśli przeglądarka wyświetla strone ze słowem "test", to konfiguracja Apache nie zezwala na użycie pliku .htaccess (w tym pliku znajdują się reguły blokujące dostęp do dowolnego pliku z rozszerzeniem .out na końcu, ponieważ są one zwykle używane do dzienników systemowych) .
Upewnij się, że plik .htaccess istnieje i jest czytelny dla wszystkich, a następnie sprawdź, czy w konfiguracji serwera Apache (witualnego hosta) występuje reguła "AllowOverride None". Należy to zmienić na "AllowOverride All".
Jeśli nie widzisz dokumentu ze słowem "test", Twój plik .htaccess działa, ale prawdopodobnie moduł mod-rewrite nie jest zainstalowany na serwerze internetowym lub nie działa. Aby go włączyć, na większości dystrybucji Linux użyj poleceń:
% a2enmod rewrite
% service apache2 restart
Skonsultuj się z dostawcą usług hostingowych, ekspertami od konkretnej dystrybucji systemu Linux lub (jeśli to Windows) dostawcą oprogramowania serwera Apache, jeśli musisz zmienić jedno z tych ustawień i nie możesz dowiedzieć się, jak to zrobić. W sieci jest dużo pomocy. Wygugluj "mod-rewrite" wraz z nazwą dystrybucji systemu operacyjnego lub pakietu Apache.
##### Jeśli przy konfiguracji bazy danych pojawi się błąd niepowodzenia wyszukania DNS
Jest to znany problem w niektórych wersjach FreeBSD, ponieważ dns_get_record()
kończy się niepowodzeniem dla niektórych wyszukiwań. Utwórz plik w głównym folderze
serwera WWW o nazwie ".htpreconfig.php" i umieść w nim następującą treść:
<?php
App::$config['system']['do_not_check_dns'] = 1;
Powinno to umożliwić kontynuację instalacji. Po zainstalowaniu bazy danych dodaj
tę samą instrukcję config (ale bez linii '<?php') do pliku .htconfig.php, który
został utworzony podczas instalacji.
##### Jeśli nie można zapisywać do pliku .htconfig.php podczas instalacji z powodu problemów z uprawnieniami
Utwórz pusty plik o tej nazwie i nadaj nu uprawnienie do zapisu przez kogokolwiek.
Dla systemów linuksowych:
% touch .htconfig.php
% chmod 777 .htconfig.php
Ponów instalację. Jak tylko baza danych zostanie utworzona,
******* to bardzo ważne *********
% chmod 755 .htconfig.php
##### Procesy Apache zwiększają się zużywając coraz więcej zasobów CPU
Wydaje się, że zdarza się to czasami, jeśli używasz mpm_prefork a proces PHP uruchomiony przez Apache nie może uzyskać dostępu do bazy danych.
Rozważ następujące ustawienia:
W /etc/apache2/mods-enabled/mpm_prefork.conf (Debian, ścieżka i nazwa pliku są różne w różnych systemach operacyjnych), ustaw
GracefulShutdownTimeout 300
Daje to pewność, że działające dzikie procesy Apache nie będą robić tego w nieskończoność, ale zostaną zabite, jeśli nie zatrzymają się pięć minut po
poleceniu zamknięcia, które zostało wysłane do procesu.
Jeśli spodziewasz się dużego obciążenia swojego serwera (np. w przypadku serwera publicznego), również upewnij się, że Apache nie wygeneruje więcej procesów niż MySQL zaakceptuje połączeń.
W pluku /etc/apache2/mods-enabled/mpm_prefork.conf (Debian) ustaw maksymalną liczbę workerów na 150:
MaxRequestWorkers 150
Jednak gdy w /etc/mysql/my.cnf maksymalna liczba połaczeń jest ustawiona na 100:
max_connections = 100
to liczba 150 workerów to dużo i prawdopodobnie za dużo dla małych serwerów. Jakkolwiek ustawisz te wartości, upewnij się, że liczba workerów Apache jest mniejsza niż liczba połączeń akceptowanych przez MySQL, pozostawiając miejsce na inne elementy na twoim serwerze, które mogą uzyskać dostęp do MySQL, a także sondę komunikacyjną, która również potrzebuje dostępu do MySQL. Dobrym ustawieniem dla portalu średniej wielkości może być utrzymanie `max_connections` MySQL na 100 i ustawienie `maxRequestWorkers` w mpm_prefork do 70.
Tutaj możesz przeczytać więcej o dostrajaniu wydajności Apache: https://httpd.apache.org/docs/2.4/misc/perf-tuning.html
Istnieje mnóstwo skryptów, które pomogą Ci dostroić instalację Apache. Po prostu wyszukaj za pomocą Google właściwy dla siebie skryptu dostrajający Apache.

View file

@ -671,18 +671,6 @@ function check_plugin_versions($info) {
return false;
}
}
if(array_key_exists('serverroles',$info)) {
$role = \Zotlabs\Lib\System::get_server_role();
if(! (
stristr($info['serverroles'],'*')
|| stristr($info['serverroles'],'any')
|| stristr($info['serverroles'],$role))) {
logger('serverrole limit: ' . $info['name'],LOGGER_NORMAL,LOG_WARNING);
return false;
}
}
if(array_key_exists('requires',$info)) {
$arr = explode(',',$info['requires']);

View file

@ -811,8 +811,7 @@ function identity_basic_export($channel_id, $sections = null) {
'project' => PLATFORM_NAME,
'codebase' => 'zap',
'version' => STD_VERSION,
'database' => DB_UPDATE_VERSION,
'server_role' => System::get_server_role()
'database' => DB_UPDATE_VERSION
];
/*

View file

@ -291,103 +291,6 @@ function localize_item(&$item){
$item['body'] = sprintf($txt, $A, t($verb));
}
/*
// FIXME store parent item as object or target
// (and update to json storage)
if (activity_match($item['verb'],ACTIVITY_TAG)) {
$r = q("SELECT * from item,contact WHERE
item.contact-id=contact.id AND item.mid='%s';",
dbesc($item['parent_mid']));
if(count($r)==0) return;
$obj=$r[0];
$author = '[zrl=' . zid($item['author-link']) . ']' . $item['author-name'] . '[/zrl]';
$objauthor = '[zrl=' . zid($obj['author-link']) . ']' . $obj['author-name'] . '[/zrl]';
switch($obj['verb']){
case ACTIVITY_POST:
switch ($obj['obj_type']){
case ACTIVITY_OBJ_EVENT:
$post_type = t('event');
break;
default:
$post_type = t('status');
}
break;
default:
if($obj['resource_id']){
$post_type = t('photo');
$m=[]; preg_match("/\[[zu]rl=([^]]*)\]/", $obj['body'], $m);
$rr['plink'] = $m[1];
} else {
$post_type = t('status');
}
}
$plink = '[zrl=' . $obj['plink'] . ']' . $post_type . '[/zrl]';
// $parsedobj = parse_xml_string($xmlhead.$item['obj']);
$tag = sprintf('#[zrl=%s]%s[/zrl]', $parsedobj->id, $parsedobj->content);
$item['body'] = sprintf( t('%1$s tagged %2$s\'s %3$s with %4$s'), $author, $objauthor, $plink, $tag );
}
if (activity_match($item['verb'],ACTIVITY_FAVORITE)){
if ($item['obj_type']== "")
return;
$Aname = $item['author']['xchan_name'];
$Alink = $item['author']['xchan_url'];
$xmlhead="<"."?xml version='1.0' encoding='UTF-8' ?".">";
// $obj = parse_xml_string($xmlhead.$item['obj']);
if(strlen($obj->id)) {
$r = q("select * from item where mid = '%s' and uid = %d limit 1",
dbesc($obj->id),
intval($item['uid'])
);
if(count($r) && $r[0]['plink']) {
$target = $r[0];
$Bname = $target['author-name'];
$Blink = $target['author-link'];
$A = '[zrl=' . zid($Alink) . ']' . $Aname . '[/zrl]';
$B = '[zrl=' . zid($Blink) . ']' . $Bname . '[/zrl]';
$P = '[zrl=' . $target['plink'] . ']' . t('post/item') . '[/zrl]';
$item['body'] = sprintf( t('%1$s marked %2$s\'s %3$s as favorite'), $A, $B, $P)."\n";
}
}
}
*/
/*
$matches = null;
if(strpos($item['body'],'[zrl') !== false) {
if(preg_match_all('/@\[zrl=(.*?)\]/is',$item['body'],$matches,PREG_SET_ORDER)) {
foreach($matches as $mtch) {
if(! strpos($mtch[1],'zid='))
$item['body'] = str_replace($mtch[0],'@[zrl=' . zid($mtch[1]). ']',$item['body']);
}
}
}
if(strpos($item['body'],'[zmg') !== false) {
// add zid's to public images
if(preg_match_all('/\[zrl=(.*?)\/photos\/(.*?)\/image\/(.*?)\]\[zmg(.*?)\]h(.*?)\[\/zmg\]\[\/zrl\]/is',$item['body'],$matches,PREG_SET_ORDER)) {
foreach($matches as $mtch) {
$item['body'] = str_replace($mtch[0],'[zrl=' . zid( $mtch[1] . '/photos/' . $mtch[2] . '/image/' . $mtch[3]) . '][zmg' . $mtch[4] . ']h' . $mtch[5] . '[/zmg][/zrl]',$item['body']);
}
}
}
*/
}
/**

View file

@ -1511,6 +1511,32 @@ function item_sign(&$item) {
$item['item_verified'] = 1;
}
// packs json data for storage.
// if it is a string, check if it is already json encoded.
// Otherwise json encode it
// If it is an array, sanitise it and then json_encode it.
function item_json_encapsulate($arr,$k) {
$retval = null;
if (isset($arr[$k])) {
if (is_string($arr[$k])) {
// determine if it is json encoded already
$test = json_decode($arr[$k]);
// assume it is json encoded already
$retval = $arr[$k];
if ($test === NULL) {
$retval = json_encode($arr[$k], JSON_UNESCAPED_SLASHES);
}
}
else {
activity_sanitise($arr[$k]);
$retval = json_encode($arr[$k], JSON_UNESCAPED_SLASHES);
}
}
return $retval;
}
/**
* @brief Stores an item type record.
@ -1638,21 +1664,19 @@ function item_store($arr, $allow_exec = false, $deliver = true, $linkid = true)
$arr = $translate['item'];
}
if((x($arr,'obj')) && is_array($arr['obj'])) {
activity_sanitise($arr['obj']);
$arr['obj'] = json_encode($arr['obj'],JSON_UNESCAPED_SLASHES);
if(x($arr,'obj')) {
$arr['obj'] = item_json_encapsulate($arr,'obj');
}
if((x($arr,'target')) && is_array($arr['target'])) {
activity_sanitise($arr['target']);
$arr['target'] = json_encode($arr['target'],JSON_UNESCAPED_SLASHES);
if(x($arr,'target')) {
$arr['target'] = item_json_encapsulate($arr,'target');
}
if((x($arr,'attach')) && is_array($arr['attach'])) {
activity_sanitise($arr['attach']);
$arr['attach'] = json_encode($arr['attach'],JSON_UNESCAPED_SLASHES);
if(x($arr,'attach')) {
$arr['attach'] = item_json_encapsulate($arr,'attach');
}
$arr['aid'] = ((x($arr,'aid')) ? intval($arr['aid']) : 0);
$arr['mid'] = ((x($arr,'mid')) ? notags(trim($arr['mid'])) : random_string());
$arr['revision'] = ((x($arr,'revision') && intval($arr['revision']) > 0) ? intval($arr['revision']) : 0);
@ -1750,8 +1774,21 @@ function item_store($arr, $allow_exec = false, $deliver = true, $linkid = true)
intval($arr['uid'])
);
// We may have this parent_mid without a token, so try that if we find a token
if($r) {
if (! $r) {
if (strpos($arr['parent_mid'],'token=')) {
$r = q("SELECT * FROM item WHERE mid = '%s' AND uid = %d ORDER BY id ASC LIMIT 1",
dbesc(substr($arr['parent_mid'],0,strpos($arr['parent_mid'],'?'))),
intval($arr['uid'])
);
if ($r) {
$arr['parent_mid'] = $arr['thr_parent'] = substr($arr['parent_mid'],0,strpos($arr['parent_mid'],'?'));
}
}
}
if ($r) {
// in case item_store was killed before the parent's parent attribute got set,
// set it now. This happens with some regularity on Dreamhost. This will keep
@ -2130,19 +2167,17 @@ function item_store_update($arr, $allow_exec = false, $deliver = true, $linkid =
$arr = $translate['item'];
}
if((array_key_exists('obj',$arr)) && is_array($arr['obj'])) {
activity_sanitise($arr['obj']);
$arr['obj'] = json_encode($arr['obj'],JSON_UNESCAPED_SLASHES);
if(x($arr,'obj')) {
$arr['obj'] = item_json_encapsulate($arr,'obj');
}
if((array_key_exists('target',$arr)) && is_array($arr['target'])) {
activity_sanitise($arr['target']);
$arr['target'] = json_encode($arr['target'],JSON_UNESCAPED_SLASHES);
if(x($arr,'target')) {
$arr['target'] = item_json_encapsulate($arr,'target');
}
if((array_key_exists('attach',$arr)) && is_array($arr['attach'])) {
activity_sanitise($arr['attach']);
$arr['attach'] = json_encode($arr['attach'],JSON_UNESCAPED_SLASHES);
if(x($arr,'attach')) {
$arr['attach'] = item_json_encapsulate($arr,'attach');
}
unset($arr['id']);
@ -3104,7 +3139,9 @@ function start_delivery_chain($channel, $item, $item_id, $parent, $group = false
$arr['owner_xchan'] = $channel['channel_hash'];
$arr['obj_type'] = $item['obj_type'];
$arr['verb'] = 'Create';
$arr['item_restrict'] = 1;
$arr['allow_cid'] = $channel['channel_allow_cid'];

View file

@ -87,7 +87,7 @@ function z_fetch_url($url, $binary = false, $redirects = 0, $opts = []) {
$passthru = true;
}
if (x($opts['useragent'])) {
if (x($opts,'useragent')) {
@curl_setopt($ch, CURLOPT_USERAGENT, $opts['useragent']);
}
else {
@ -1283,7 +1283,6 @@ function get_site_info() {
'version' => $version,
// 'version_tag' => $tag,
'addon_version' => defined('ADDON_VERSION') ? ADDON_VERSION : 'unknown',
'server_role' => System::get_server_role(),
'commit' => $commit,
'protocols' => $protocols,
'plugins' => $visible_plugins,

View file

@ -371,7 +371,7 @@ function photo_upload($channel, $observer, $args) {
$large_photos = 1;
linkify_tags($args['body'], $channel_id);
$found_tags = linkify_tags($args['body'], $channel_id);
$alt = ' alt="' . $title . '"' ;
@ -434,6 +434,23 @@ function photo_upload($channel, $observer, $args) {
'id' => z_root() . '/album/' . $channel['channel_address'] . ((isset($args['folder'])) ? '/' . $args['folder'] : EMPTY_STR)
];
$post_tags = [];
if($found_tags) {
foreach($found_tags as $result) {
$success = $result['success'];
if($success['replaced']) {
$post_tags[] = array(
'uid' => $channel['channel_id'],
'ttype' => $success['termtype'],
'otype' => TERM_OBJ_POST,
'term' => $success['term'],
'url' => $success['url']
);
}
}
}
// Create item container
if($args['item']) {
foreach($args['item'] as $i) {
@ -451,7 +468,9 @@ function photo_upload($channel, $observer, $args) {
$item['tgt_type'] = 'orderedCollection';
$item['target'] = json_encode($target);
if ($post_tags) {
$arr['term'] = $post_tags;
}
$force = true;
}
$r = q("select id, edited from item where mid = '%s' and uid = %d limit 1",
@ -510,6 +529,10 @@ function photo_upload($channel, $observer, $args) {
'body' => $summary
];
if ($post_tags) {
$arr['term'] = $post_tags;
}
$arr['plink'] = z_root() . '/channel/' . $channel['channel_address'] . '/?f=&mid=' . urlencode($arr['mid']);
if($lat && $lon)

View file

@ -154,6 +154,10 @@ function purify_html($s, $opts = []) {
$config->set('Cache.DefinitionImpl', null);
$config->set('Attr.EnableID', true);
// disable Unicode version of RTL over-ride
$s = str_replace([ '&#x202e;', '&#x202E;', html_entity_decode('&#x202e;', ENT_QUOTES,'UTF-8') ],[ '','','' ],$s);
// This will escape invalid tags in the output instead of removing.
// This is necessary for mixed format (text+bbcode+html+markdown) messages or
// some angle brackets in plaintext may get stripped if they look like an HTML tag
@ -1818,7 +1822,8 @@ function prepare_body(&$item,$attach = false,$opts = false) {
}
$cache_enable = ((($cache_expire) && ($item['created'] < datetime_convert('UTC','UTC', 'now - ' . $cache_expire . ' days'))) ? false : true);
// disable Unicode RTL over-ride since it can destroy presentation in some cases, use HTML or CSS instead
$s = str_replace([ '&#x202e;', '&#x202E;', html_entity_decode('&#x202e;', ENT_QUOTES,'UTF-8') ],[ '','','' ],$s);
if($s)
$s = sslify($s, $cache_enable);

File diff suppressed because it is too large Load diff

View file

@ -25,12 +25,12 @@ class InstalledVersions
private static $installed = array (
'root' =>
array (
'pretty_version' => 'dev-dev',
'version' => 'dev-dev',
'pretty_version' => 'dev-master',
'version' => 'dev-master',
'aliases' =>
array (
),
'reference' => '7f4e6c2b64be07ce7587dc906e1d65494121a534',
'reference' => '441261e2d8ac174792bcb1f37f44e74d1d5c0213',
'name' => 'zot/zap',
),
'versions' =>
@ -154,12 +154,12 @@ class InstalledVersions
),
'phpseclib/phpseclib' =>
array (
'pretty_version' => '2.0.31',
'version' => '2.0.31.0',
'pretty_version' => '2.0.32',
'version' => '2.0.32.0',
'aliases' =>
array (
),
'reference' => '233a920cb38636a43b18d428f9a8db1f0a1a08f4',
'reference' => 'f5c4c19880d45d0be3e7d24ae8ac434844a898cd',
),
'psr/log' =>
array (
@ -269,48 +269,48 @@ class InstalledVersions
),
'symfony/options-resolver' =>
array (
'pretty_version' => 'v5.2.4',
'version' => '5.2.4.0',
'pretty_version' => 'v5.3.0',
'version' => '5.3.0.0',
'aliases' =>
array (
),
'reference' => '5d0f633f9bbfcf7ec642a2b5037268e61b0a62ce',
'reference' => '162e886ca035869866d233a2bfef70cc28f9bbe5',
),
'symfony/polyfill-ctype' =>
array (
'pretty_version' => 'v1.22.1',
'version' => '1.22.1.0',
'pretty_version' => 'v1.23.0',
'version' => '1.23.0.0',
'aliases' =>
array (
),
'reference' => 'c6c942b1ac76c82448322025e084cadc56048b4e',
'reference' => '46cd95797e9df938fdd2b03693b5fca5e64b01ce',
),
'symfony/polyfill-php73' =>
array (
'pretty_version' => 'v1.22.1',
'version' => '1.22.1.0',
'pretty_version' => 'v1.23.0',
'version' => '1.23.0.0',
'aliases' =>
array (
),
'reference' => 'a678b42e92f86eca04b7fa4c0f6f19d097fb69e2',
'reference' => 'fba8933c384d6476ab14fb7b8526e5287ca7e010',
),
'symfony/polyfill-php80' =>
array (
'pretty_version' => 'v1.22.1',
'version' => '1.22.1.0',
'pretty_version' => 'v1.23.0',
'version' => '1.23.0.0',
'aliases' =>
array (
),
'reference' => 'dc3063ba22c2a1fd2f45ed856374d79114998f91',
'reference' => 'eca0bf41ed421bed1b57c4958bab16aa86b757d0',
),
'symfony/process' =>
array (
'pretty_version' => 'v5.2.7',
'version' => '5.2.7.0',
'pretty_version' => 'v5.3.0',
'version' => '5.3.0.0',
'aliases' =>
array (
),
'reference' => '98cb8eeb72e55d4196dd1e36f1f16e7b3a9a088e',
'reference' => '53e36cb1c160505cdaf1ef201501669c4c317191',
),
'twbs/bootstrap' =>
array (
@ -348,12 +348,12 @@ class InstalledVersions
),
'zot/zap' =>
array (
'pretty_version' => 'dev-dev',
'version' => 'dev-dev',
'pretty_version' => 'dev-master',
'version' => 'dev-master',
'aliases' =>
array (
),
'reference' => '7f4e6c2b64be07ce7587dc906e1d65494121a534',
'reference' => '441261e2d8ac174792bcb1f37f44e74d1d5c0213',
),
),
);

View file

@ -435,9 +435,6 @@ return array(
'Psr\\Log\\LoggerInterface' => $vendorDir . '/psr/log/Psr/Log/LoggerInterface.php',
'Psr\\Log\\LoggerTrait' => $vendorDir . '/psr/log/Psr/Log/LoggerTrait.php',
'Psr\\Log\\NullLogger' => $vendorDir . '/psr/log/Psr/Log/NullLogger.php',
'Psr\\Log\\Test\\DummyTest' => $vendorDir . '/psr/log/Psr/Log/Test/DummyTest.php',
'Psr\\Log\\Test\\LoggerInterfaceTest' => $vendorDir . '/psr/log/Psr/Log/Test/LoggerInterfaceTest.php',
'Psr\\Log\\Test\\TestLogger' => $vendorDir . '/psr/log/Psr/Log/Test/TestLogger.php',
'Ramsey\\Uuid\\BinaryUtils' => $vendorDir . '/ramsey/uuid/src/BinaryUtils.php',
'Ramsey\\Uuid\\Builder\\DefaultUuidBuilder' => $vendorDir . '/ramsey/uuid/src/Builder/DefaultUuidBuilder.php',
'Ramsey\\Uuid\\Builder\\DegradedUuidBuilder' => $vendorDir . '/ramsey/uuid/src/Builder/DegradedUuidBuilder.php',

View file

@ -13,12 +13,12 @@ return array(
'a1cce3d26cc15c00fcd0b3354bd72c88' => $vendorDir . '/sabre/event/lib/Promise/functions.php',
'3569eecfeed3bcf0bad3c998a494ecb8' => $vendorDir . '/sabre/xml/lib/Deserializer/functions.php',
'93aa591bc4ca510c520999e34229ee79' => $vendorDir . '/sabre/xml/lib/Serializer/functions.php',
'0d59ee240a4cd96ddbb4ff164fccea4d' => $vendorDir . '/symfony/polyfill-php73/bootstrap.php',
'6e3fae29631ef280660b3cdad06f25a8' => $vendorDir . '/symfony/deprecation-contracts/function.php',
'0d59ee240a4cd96ddbb4ff164fccea4d' => $vendorDir . '/symfony/polyfill-php73/bootstrap.php',
'ebdb698ed4152ae445614b69b5e4bb6a' => $vendorDir . '/sabre/http/lib/functions.php',
'320cde22f66dd4f5d3fd621d3e88b98f' => $vendorDir . '/symfony/polyfill-ctype/bootstrap.php',
'2cffec82183ee1cea088009cef9a6fc3' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier.composer.php',
'd08bec471a180204a14ef3c91e951f99' => $vendorDir . '/p3k/emoji-detector/src/Emoji.php',
'e39a8b23c42d4e1452234d762b03835a' => $vendorDir . '/ramsey/uuid/src/functions.php',
'decc78cc4436b1292c6c0d151b19445c' => $vendorDir . '/phpseclib/phpseclib/phpseclib/bootstrap.php',
'e39a8b23c42d4e1452234d762b03835a' => $vendorDir . '/ramsey/uuid/src/functions.php',
);

View file

@ -14,14 +14,14 @@ class ComposerStaticInit7b34d7e50a62201ec5d5e526a5b8b35d
'a1cce3d26cc15c00fcd0b3354bd72c88' => __DIR__ . '/..' . '/sabre/event/lib/Promise/functions.php',
'3569eecfeed3bcf0bad3c998a494ecb8' => __DIR__ . '/..' . '/sabre/xml/lib/Deserializer/functions.php',
'93aa591bc4ca510c520999e34229ee79' => __DIR__ . '/..' . '/sabre/xml/lib/Serializer/functions.php',
'0d59ee240a4cd96ddbb4ff164fccea4d' => __DIR__ . '/..' . '/symfony/polyfill-php73/bootstrap.php',
'6e3fae29631ef280660b3cdad06f25a8' => __DIR__ . '/..' . '/symfony/deprecation-contracts/function.php',
'0d59ee240a4cd96ddbb4ff164fccea4d' => __DIR__ . '/..' . '/symfony/polyfill-php73/bootstrap.php',
'ebdb698ed4152ae445614b69b5e4bb6a' => __DIR__ . '/..' . '/sabre/http/lib/functions.php',
'320cde22f66dd4f5d3fd621d3e88b98f' => __DIR__ . '/..' . '/symfony/polyfill-ctype/bootstrap.php',
'2cffec82183ee1cea088009cef9a6fc3' => __DIR__ . '/..' . '/ezyang/htmlpurifier/library/HTMLPurifier.composer.php',
'd08bec471a180204a14ef3c91e951f99' => __DIR__ . '/..' . '/p3k/emoji-detector/src/Emoji.php',
'e39a8b23c42d4e1452234d762b03835a' => __DIR__ . '/..' . '/ramsey/uuid/src/functions.php',
'decc78cc4436b1292c6c0d151b19445c' => __DIR__ . '/..' . '/phpseclib/phpseclib/phpseclib/bootstrap.php',
'e39a8b23c42d4e1452234d762b03835a' => __DIR__ . '/..' . '/ramsey/uuid/src/functions.php',
);
public static $prefixLengthsPsr4 = array (
@ -652,9 +652,6 @@ class ComposerStaticInit7b34d7e50a62201ec5d5e526a5b8b35d
'Psr\\Log\\LoggerInterface' => __DIR__ . '/..' . '/psr/log/Psr/Log/LoggerInterface.php',
'Psr\\Log\\LoggerTrait' => __DIR__ . '/..' . '/psr/log/Psr/Log/LoggerTrait.php',
'Psr\\Log\\NullLogger' => __DIR__ . '/..' . '/psr/log/Psr/Log/NullLogger.php',
'Psr\\Log\\Test\\DummyTest' => __DIR__ . '/..' . '/psr/log/Psr/Log/Test/DummyTest.php',
'Psr\\Log\\Test\\LoggerInterfaceTest' => __DIR__ . '/..' . '/psr/log/Psr/Log/Test/LoggerInterfaceTest.php',
'Psr\\Log\\Test\\TestLogger' => __DIR__ . '/..' . '/psr/log/Psr/Log/Test/TestLogger.php',
'Ramsey\\Uuid\\BinaryUtils' => __DIR__ . '/..' . '/ramsey/uuid/src/BinaryUtils.php',
'Ramsey\\Uuid\\Builder\\DefaultUuidBuilder' => __DIR__ . '/..' . '/ramsey/uuid/src/Builder/DefaultUuidBuilder.php',
'Ramsey\\Uuid\\Builder\\DegradedUuidBuilder' => __DIR__ . '/..' . '/ramsey/uuid/src/Builder/DegradedUuidBuilder.php',

View file

@ -753,17 +753,17 @@
},
{
"name": "phpseclib/phpseclib",
"version": "2.0.31",
"version_normalized": "2.0.31.0",
"version": "2.0.32",
"version_normalized": "2.0.32.0",
"source": {
"type": "git",
"url": "https://github.com/phpseclib/phpseclib.git",
"reference": "233a920cb38636a43b18d428f9a8db1f0a1a08f4"
"reference": "f5c4c19880d45d0be3e7d24ae8ac434844a898cd"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/233a920cb38636a43b18d428f9a8db1f0a1a08f4",
"reference": "233a920cb38636a43b18d428f9a8db1f0a1a08f4",
"url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/f5c4c19880d45d0be3e7d24ae8ac434844a898cd",
"reference": "f5c4c19880d45d0be3e7d24ae8ac434844a898cd",
"shasum": ""
},
"require": {
@ -780,7 +780,7 @@
"ext-mcrypt": "Install the Mcrypt extension in order to speed up a few other cryptographic operations.",
"ext-openssl": "Install the OpenSSL extension in order to speed up a wide variety of cryptographic operations."
},
"time": "2021-04-06T13:56:45+00:00",
"time": "2021-06-12T12:12:59+00:00",
"type": "library",
"installation-source": "source",
"autoload": {
@ -845,7 +845,7 @@
],
"support": {
"issues": "https://github.com/phpseclib/phpseclib/issues",
"source": "https://github.com/phpseclib/phpseclib/tree/2.0.31"
"source": "https://github.com/phpseclib/phpseclib/tree/2.0.32"
},
"funding": [
{
@ -1619,17 +1619,17 @@
},
{
"name": "symfony/options-resolver",
"version": "v5.2.4",
"version_normalized": "5.2.4.0",
"version": "v5.3.0",
"version_normalized": "5.3.0.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/options-resolver.git",
"reference": "5d0f633f9bbfcf7ec642a2b5037268e61b0a62ce"
"reference": "162e886ca035869866d233a2bfef70cc28f9bbe5"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/options-resolver/zipball/5d0f633f9bbfcf7ec642a2b5037268e61b0a62ce",
"reference": "5d0f633f9bbfcf7ec642a2b5037268e61b0a62ce",
"url": "https://api.github.com/repos/symfony/options-resolver/zipball/162e886ca035869866d233a2bfef70cc28f9bbe5",
"reference": "162e886ca035869866d233a2bfef70cc28f9bbe5",
"shasum": ""
},
"require": {
@ -1638,9 +1638,9 @@
"symfony/polyfill-php73": "~1.0",
"symfony/polyfill-php80": "^1.15"
},
"time": "2021-01-27T12:56:27+00:00",
"time": "2021-05-26T17:43:10+00:00",
"type": "library",
"installation-source": "dist",
"installation-source": "source",
"autoload": {
"psr-4": {
"Symfony\\Component\\OptionsResolver\\": ""
@ -1670,6 +1670,9 @@
"configuration",
"options"
],
"support": {
"source": "https://github.com/symfony/options-resolver/tree/v5.3.0"
},
"funding": [
{
"url": "https://symfony.com/sponsor",
@ -1688,17 +1691,17 @@
},
{
"name": "symfony/polyfill-ctype",
"version": "v1.22.1",
"version_normalized": "1.22.1.0",
"version": "v1.23.0",
"version_normalized": "1.23.0.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-ctype.git",
"reference": "c6c942b1ac76c82448322025e084cadc56048b4e"
"reference": "46cd95797e9df938fdd2b03693b5fca5e64b01ce"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/c6c942b1ac76c82448322025e084cadc56048b4e",
"reference": "c6c942b1ac76c82448322025e084cadc56048b4e",
"url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/46cd95797e9df938fdd2b03693b5fca5e64b01ce",
"reference": "46cd95797e9df938fdd2b03693b5fca5e64b01ce",
"shasum": ""
},
"require": {
@ -1707,18 +1710,18 @@
"suggest": {
"ext-ctype": "For best performance"
},
"time": "2021-01-07T16:49:33+00:00",
"time": "2021-02-19T12:13:01+00:00",
"type": "library",
"extra": {
"branch-alias": {
"dev-main": "1.22-dev"
"dev-main": "1.23-dev"
},
"thanks": {
"name": "symfony/polyfill",
"url": "https://github.com/symfony/polyfill"
}
},
"installation-source": "dist",
"installation-source": "source",
"autoload": {
"psr-4": {
"Symfony\\Polyfill\\Ctype\\": ""
@ -1749,6 +1752,9 @@
"polyfill",
"portable"
],
"support": {
"source": "https://github.com/symfony/polyfill-ctype/tree/v1.23.0"
},
"funding": [
{
"url": "https://symfony.com/sponsor",
@ -1767,34 +1773,34 @@
},
{
"name": "symfony/polyfill-php73",
"version": "v1.22.1",
"version_normalized": "1.22.1.0",
"version": "v1.23.0",
"version_normalized": "1.23.0.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-php73.git",
"reference": "a678b42e92f86eca04b7fa4c0f6f19d097fb69e2"
"reference": "fba8933c384d6476ab14fb7b8526e5287ca7e010"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/a678b42e92f86eca04b7fa4c0f6f19d097fb69e2",
"reference": "a678b42e92f86eca04b7fa4c0f6f19d097fb69e2",
"url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/fba8933c384d6476ab14fb7b8526e5287ca7e010",
"reference": "fba8933c384d6476ab14fb7b8526e5287ca7e010",
"shasum": ""
},
"require": {
"php": ">=7.1"
},
"time": "2021-01-07T16:49:33+00:00",
"time": "2021-02-19T12:13:01+00:00",
"type": "library",
"extra": {
"branch-alias": {
"dev-main": "1.22-dev"
"dev-main": "1.23-dev"
},
"thanks": {
"name": "symfony/polyfill",
"url": "https://github.com/symfony/polyfill"
}
},
"installation-source": "dist",
"installation-source": "source",
"autoload": {
"psr-4": {
"Symfony\\Polyfill\\Php73\\": ""
@ -1828,6 +1834,9 @@
"portable",
"shim"
],
"support": {
"source": "https://github.com/symfony/polyfill-php73/tree/v1.23.0"
},
"funding": [
{
"url": "https://symfony.com/sponsor",
@ -1846,34 +1855,34 @@
},
{
"name": "symfony/polyfill-php80",
"version": "v1.22.1",
"version_normalized": "1.22.1.0",
"version": "v1.23.0",
"version_normalized": "1.23.0.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-php80.git",
"reference": "dc3063ba22c2a1fd2f45ed856374d79114998f91"
"reference": "eca0bf41ed421bed1b57c4958bab16aa86b757d0"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/dc3063ba22c2a1fd2f45ed856374d79114998f91",
"reference": "dc3063ba22c2a1fd2f45ed856374d79114998f91",
"url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/eca0bf41ed421bed1b57c4958bab16aa86b757d0",
"reference": "eca0bf41ed421bed1b57c4958bab16aa86b757d0",
"shasum": ""
},
"require": {
"php": ">=7.1"
},
"time": "2021-01-07T16:49:33+00:00",
"time": "2021-02-19T12:13:01+00:00",
"type": "library",
"extra": {
"branch-alias": {
"dev-main": "1.22-dev"
"dev-main": "1.23-dev"
},
"thanks": {
"name": "symfony/polyfill",
"url": "https://github.com/symfony/polyfill"
}
},
"installation-source": "dist",
"installation-source": "source",
"autoload": {
"psr-4": {
"Symfony\\Polyfill\\Php80\\": ""
@ -1911,6 +1920,9 @@
"portable",
"shim"
],
"support": {
"source": "https://github.com/symfony/polyfill-php80/tree/v1.23.0"
},
"funding": [
{
"url": "https://symfony.com/sponsor",
@ -1929,24 +1941,24 @@
},
{
"name": "symfony/process",
"version": "v5.2.7",
"version_normalized": "5.2.7.0",
"version": "v5.3.0",
"version_normalized": "5.3.0.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/process.git",
"reference": "98cb8eeb72e55d4196dd1e36f1f16e7b3a9a088e"
"reference": "53e36cb1c160505cdaf1ef201501669c4c317191"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/process/zipball/98cb8eeb72e55d4196dd1e36f1f16e7b3a9a088e",
"reference": "98cb8eeb72e55d4196dd1e36f1f16e7b3a9a088e",
"url": "https://api.github.com/repos/symfony/process/zipball/53e36cb1c160505cdaf1ef201501669c4c317191",
"reference": "53e36cb1c160505cdaf1ef201501669c4c317191",
"shasum": ""
},
"require": {
"php": ">=7.2.5",
"symfony/polyfill-php80": "^1.15"
},
"time": "2021-04-08T10:27:02+00:00",
"time": "2021-05-26T12:52:38+00:00",
"type": "library",
"installation-source": "source",
"autoload": {
@ -1974,7 +1986,7 @@
"description": "Executes commands in sub-processes",
"homepage": "https://symfony.com",
"support": {
"source": "https://github.com/symfony/process/tree/v5.3.0-BETA1"
"source": "https://github.com/symfony/process/tree/v5.3.0"
},
"funding": [
{

View file

@ -1,12 +1,12 @@
<?php return array (
'root' =>
array (
'pretty_version' => 'dev-dev',
'version' => 'dev-dev',
'pretty_version' => 'dev-master',
'version' => 'dev-master',
'aliases' =>
array (
),
'reference' => '7f4e6c2b64be07ce7587dc906e1d65494121a534',
'reference' => '441261e2d8ac174792bcb1f37f44e74d1d5c0213',
'name' => 'zot/zap',
),
'versions' =>
@ -130,12 +130,12 @@
),
'phpseclib/phpseclib' =>
array (
'pretty_version' => '2.0.31',
'version' => '2.0.31.0',
'pretty_version' => '2.0.32',
'version' => '2.0.32.0',
'aliases' =>
array (
),
'reference' => '233a920cb38636a43b18d428f9a8db1f0a1a08f4',
'reference' => 'f5c4c19880d45d0be3e7d24ae8ac434844a898cd',
),
'psr/log' =>
array (
@ -245,48 +245,48 @@
),
'symfony/options-resolver' =>
array (
'pretty_version' => 'v5.2.4',
'version' => '5.2.4.0',
'pretty_version' => 'v5.3.0',
'version' => '5.3.0.0',
'aliases' =>
array (
),
'reference' => '5d0f633f9bbfcf7ec642a2b5037268e61b0a62ce',
'reference' => '162e886ca035869866d233a2bfef70cc28f9bbe5',
),
'symfony/polyfill-ctype' =>
array (
'pretty_version' => 'v1.22.1',
'version' => '1.22.1.0',
'pretty_version' => 'v1.23.0',
'version' => '1.23.0.0',
'aliases' =>
array (
),
'reference' => 'c6c942b1ac76c82448322025e084cadc56048b4e',
'reference' => '46cd95797e9df938fdd2b03693b5fca5e64b01ce',
),
'symfony/polyfill-php73' =>
array (
'pretty_version' => 'v1.22.1',
'version' => '1.22.1.0',
'pretty_version' => 'v1.23.0',
'version' => '1.23.0.0',
'aliases' =>
array (
),
'reference' => 'a678b42e92f86eca04b7fa4c0f6f19d097fb69e2',
'reference' => 'fba8933c384d6476ab14fb7b8526e5287ca7e010',
),
'symfony/polyfill-php80' =>
array (
'pretty_version' => 'v1.22.1',
'version' => '1.22.1.0',
'pretty_version' => 'v1.23.0',
'version' => '1.23.0.0',
'aliases' =>
array (
),
'reference' => 'dc3063ba22c2a1fd2f45ed856374d79114998f91',
'reference' => 'eca0bf41ed421bed1b57c4958bab16aa86b757d0',
),
'symfony/process' =>
array (
'pretty_version' => 'v5.2.7',
'version' => '5.2.7.0',
'pretty_version' => 'v5.3.0',
'version' => '5.3.0.0',
'aliases' =>
array (
),
'reference' => '98cb8eeb72e55d4196dd1e36f1f16e7b3a9a088e',
'reference' => '53e36cb1c160505cdaf1ef201501669c4c317191',
),
'twbs/bootstrap' =>
array (
@ -324,12 +324,12 @@
),
'zot/zap' =>
array (
'pretty_version' => 'dev-dev',
'version' => 'dev-dev',
'pretty_version' => 'dev-master',
'version' => 'dev-master',
'aliases' =>
array (
),
'reference' => '7f4e6c2b64be07ce7587dc906e1d65494121a534',
'reference' => '441261e2d8ac174792bcb1f37f44e74d1d5c0213',
),
),
);

View file

@ -28,13 +28,7 @@ matrix:
before_install: true
install:
- wget http://ftp.gnu.org/gnu/parallel/parallel-20170822.tar.bz2
- tar -xvjf parallel*
- cd parallel-20170822
- ./configure
- make
- sudo make install
- cd ..
- phpenv config-rm xdebug.ini
- eval `ssh-agent -s`
- travis/setup-secure-shell.sh
- sh -c "if [ '$TRAVIS_PHP_VERSION' != 'hhvm' -a `php -r "echo (int) version_compare(PHP_VERSION, '7.0', '<');"` = "1" ]; then travis/install-php-extensions.sh; fi"

View file

@ -2580,9 +2580,9 @@ class RSA
$offset+= $patternMatch ? 0 : 1;
}
// we do & instead of && to avoid https://en.wikipedia.org/wiki/Short-circuit_evaluation
// we do | instead of || to avoid https://en.wikipedia.org/wiki/Short-circuit_evaluation
// to protect against timing attacks
if (!$hashesMatch & !$patternMatch) {
if (!$hashesMatch | !$patternMatch) {
user_error('Decryption error');
return false;
}

View file

@ -993,7 +993,10 @@ class ASN1
case self::TYPE_GENERALIZED_TIME:
$format = $mapping['type'] == self::TYPE_UTC_TIME ? 'y' : 'Y';
$format.= 'mdHis';
// if $source does _not_ include timezone information within it then assume that the timezone is GMT
$date = new DateTime($source, new DateTimeZone('GMT'));
// if $source _does_ include timezone information within it then convert the time to GMT
$date->setTimezone(new DateTimeZone('GMT'));
$value = $date->format($format) . 'Z';
break;
case self::TYPE_BIT_STRING:

View file

@ -5058,7 +5058,7 @@ class X509
$temp = $str;
} else {
$temp = preg_replace('#.*?^-+[^-]+-+[\r\n ]*$#ms', '', $str, 1);
$temp = preg_replace('#-+END.*[\r\n ]*.*#ms', '', $str, 1);
$temp = preg_replace('#-+END.*[\r\n ]*.*#ms', '', $temp, 1);
}
// remove new lines
$temp = str_replace(array("\r", "\n", ' '), '', $temp);

View file

@ -269,6 +269,16 @@ class SFTP extends SSH2
*/
var $preserveTime = false;
/**
* Was the last packet due to the channels being closed or not?
*
* @see self::get()
* @see self::get_sftp_packet()
* @var bool
* @access private
*/
var $channel_close = false;
/**
* Default Constructor.
*
@ -425,6 +435,17 @@ class SFTP extends SSH2
return false;
}
return $this->_init_sftp_connection();
}
/**
* (Re)initializes the SFTP channel
*
* @return bool
* @access private
*/
function _init_sftp_connection()
{
$this->window_size_server_to_client[self::CHANNEL] = $this->window_size;
$packet = pack(
@ -2293,7 +2314,13 @@ class SFTP extends SSH2
if ($fclose_check) {
fclose($fp);
}
user_error('Expected SSH_FX_DATA or SSH_FXP_STATUS');
// maybe the file was successfully transferred, maybe it wasn't
if ($this->channel_close) {
$this->_init_sftp_connection();
return false;
} else {
user_error('Expected SSH_FX_DATA or SSH_FXP_STATUS');
}
}
$response = null;
}
@ -3055,6 +3082,8 @@ class SFTP extends SSH2
*/
function _get_sftp_packet($request_id = null)
{
$this->channel_close = false;
if (isset($request_id) && isset($this->requestBuffer[$request_id])) {
$this->packet_type = $this->requestBuffer[$request_id]['packet_type'];
$temp = $this->requestBuffer[$request_id]['packet'];
@ -3071,7 +3100,10 @@ class SFTP extends SSH2
// SFTP packet length
while (strlen($this->packet_buffer) < 4) {
$temp = $this->_get_channel_packet(self::CHANNEL, true);
if (is_bool($temp)) {
if ($temp === true) {
if ($this->channel_status[self::CHANNEL] === NET_SSH2_MSG_CHANNEL_CLOSE) {
$this->channel_close = true;
}
$this->packet_type = false;
$this->packet_buffer = '';
return false;

View file

@ -970,6 +970,14 @@ class SSH2
*/
var $auth = array();
/**
* The authentication methods that may productively continue authentication.
*
* @see https://tools.ietf.org/html/rfc4252#section-5.1
* @var array|null
*/
private $auth_methods_to_continue = null;
/**
* Default Constructor.
*
@ -1347,6 +1355,7 @@ class SSH2
function _key_exchange($kexinit_payload_server = false)
{
$preferred = $this->preferred;
$send_kex = true;
$kex_algorithms = isset($preferred['kex']) ?
$preferred['kex'] :
@ -1430,7 +1439,7 @@ class SSH2
0
);
if ($this->send_kex_first) {
if ($kexinit_payload_server === false) {
if (!$this->_send_binary_packet($kexinit_payload_client)) {
return false;
}
@ -1446,6 +1455,8 @@ class SSH2
user_error('Expected SSH_MSG_KEXINIT');
return false;
}
$send_kex = false;
}
$response = $kexinit_payload_server;
@ -1518,7 +1529,7 @@ class SSH2
extract(unpack('Cfirst_kex_packet_follows', $this->_string_shift($response, 1)));
$first_kex_packet_follows = $first_kex_packet_follows != 0;
if (!$this->send_kex_first && !$this->_send_binary_packet($kexinit_payload_client)) {
if ($send_kex && !$this->_send_binary_packet($kexinit_payload_client)) {
return false;
}
@ -2131,7 +2142,7 @@ class SSH2
// try logging with 'none' as an authentication method first since that's what
// PuTTY does
if (substr($this->server_identifier, 0, 13) != 'SSH-2.0-CoreFTP') {
if (substr($this->server_identifier, 0, 13) != 'SSH-2.0-CoreFTP' && $this->auth_methods_to_continue === null) {
if ($this->_login($username)) {
return true;
}
@ -2275,7 +2286,9 @@ class SSH2
case NET_SSH2_MSG_USERAUTH_SUCCESS:
$this->bitmap |= self::MASK_LOGIN;
return true;
//case NET_SSH2_MSG_USERAUTH_FAILURE:
case NET_SSH2_MSG_USERAUTH_FAILURE:
extract(unpack('Nmethodlistlen', $this->_string_shift($response, 4)));
$this->auth_methods_to_continue = explode(',', $this->_string_shift($response, $methodlistlen));
default:
return false;
}
@ -2347,6 +2360,7 @@ class SSH2
}
extract(unpack('Nlength', $this->_string_shift($response, 4)));
$auth_methods = explode(',', $this->_string_shift($response, $length));
$this->auth_methods_to_continue = $auth_methods;
if (!strlen($response)) {
return false;
}
@ -2519,6 +2533,8 @@ class SSH2
case NET_SSH2_MSG_USERAUTH_SUCCESS:
return true;
case NET_SSH2_MSG_USERAUTH_FAILURE:
extract(unpack('Nmethodlistlen', $this->_string_shift($response, 4)));
$this->auth_methods_to_continue = explode(',', $this->_string_shift($response, $methodlistlen));
return false;
}
@ -2627,8 +2643,9 @@ class SSH2
if (strlen($response) < 4) {
return false;
}
extract(unpack('Nlength', $this->_string_shift($response, 4)));
$this->errors[] = 'SSH_MSG_USERAUTH_FAILURE: ' . $this->_string_shift($response, $length);
extract(unpack('Nmethodlistlen', $this->_string_shift($response, 4)));
$this->auth_methods_to_continue = explode(',', $this->_string_shift($response, $methodlistlen));
$this->errors[] = 'SSH_MSG_USERAUTH_FAILURE';
return false;
case NET_SSH2_MSG_USERAUTH_PK_OK:
// we'll just take it on faith that the public key blob and the public key algorithm name are as
@ -2669,6 +2686,8 @@ class SSH2
switch ($type) {
case NET_SSH2_MSG_USERAUTH_FAILURE:
// either the login is bad or the server employs multi-factor authentication
extract(unpack('Nmethodlistlen', $this->_string_shift($response, 4)));
$this->auth_methods_to_continue = explode(',', $this->_string_shift($response, $methodlistlen));
return false;
case NET_SSH2_MSG_USERAUTH_SUCCESS:
$this->bitmap |= self::MASK_LOGIN;
@ -3319,7 +3338,7 @@ class SSH2
$read = array($this->fsock);
$write = $except = null;
if ($this->curTimeout <= 0) {
if (!$this->curTimeout) {
if ($this->keepAlive <= 0) {
@stream_select($read, $write, $except, null);
} else {
@ -3513,6 +3532,10 @@ class SSH2
// only called when we've already logged in
if (($this->bitmap & self::MASK_CONNECTED) && $this->isAuthenticated()) {
if (is_bool($payload)) {
return $payload;
}
switch (ord($payload[0])) {
case NET_SSH2_MSG_CHANNEL_REQUEST:
if (strlen($payload) == 31) {
@ -5143,4 +5166,15 @@ class SSH2
);
}
}
/**
* Return the list of authentication methods that may productively continue authentication.
*
* @see https://tools.ietf.org/html/rfc4252#section-5.1
* @return array|null
*/
public function getAuthMethodsToContinue()
{
return $this->auth_methods_to_continue;
}
}

View file

@ -37,15 +37,8 @@ then
find tests -type f -name "*.php" -print0 | xargs -0 sed -i 's/extends Unit_Crypt_Hash_\(SHA512Test\|SHA256Test\)/extends \1/g'
fi
if [ "$TRAVIS_PHP_VERSION" = 'hhvm' -o `php -r "echo (int) version_compare(PHP_VERSION, '7.0', '>=');"` = "1" ]
then
find tests -type f -name "*Test.php" | \
parallel --gnu --keep-order \
"echo '== {} =='; \"$PHPUNIT\" $PHPUNIT_ARGS {};"
else
"$PHPUNIT" \
$PHPUNIT_ARGS \
--coverage-text \
--coverage-clover code_coverage/clover.xml \
--coverage-html code_coverage/
fi
"$PHPUNIT" \
$PHPUNIT_ARGS \
--coverage-text \
--coverage-clover code_coverage/clover.xml \
--coverage-html code_coverage/

View file

@ -0,0 +1,4 @@
/Tests export-ignore
/phpunit.xml.dist export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore

View file

@ -0,0 +1,3 @@
vendor/
composer.lock
phpunit.xml

View file

@ -1,6 +1,11 @@
CHANGELOG
=========
5.3
---
* Add prototype definition for nested options
5.1.0
-----

View file

@ -130,6 +130,16 @@ class OptionsResolver implements Options
private $parentsOptions = [];
/**
* Whether the whole options definition is marked as array prototype.
*/
private $prototype;
/**
* The prototype array's index that is being read.
*/
private $prototypeIndex;
/**
* Sets the default value of a given option.
*
@ -789,6 +799,33 @@ class OptionsResolver implements Options
return $this->info[$option] ?? null;
}
/**
* Marks the whole options definition as array prototype.
*
* @return $this
*
* @throws AccessException If called from a lazy option, a normalizer or a root definition
*/
public function setPrototype(bool $prototype): self
{
if ($this->locked) {
throw new AccessException('The prototype property cannot be set from a lazy option or normalizer.');
}
if (null === $this->prototype && $prototype) {
throw new AccessException('The prototype property cannot be set from a root definition.');
}
$this->prototype = $prototype;
return $this;
}
public function isPrototype(): bool
{
return $this->prototype ?? false;
}
/**
* Removes the option with the given name.
*
@ -970,13 +1007,29 @@ class OptionsResolver implements Options
$this->calling[$option] = true;
try {
$resolver = new self();
$resolver->prototype = false;
$resolver->parentsOptions = $this->parentsOptions;
$resolver->parentsOptions[] = $option;
foreach ($this->nested[$option] as $closure) {
$closure($resolver, $this);
}
$value = $resolver->resolve($value);
if ($resolver->prototype) {
$values = [];
foreach ($value as $index => $prototypeValue) {
if (!\is_array($prototypeValue)) {
throw new InvalidOptionsException(sprintf('The value of the option "%s" is expected to be of type array of array, but is of type array of "%s".', $this->formatOptions([$option]), get_debug_type($prototypeValue)));
}
$resolver->prototypeIndex = $index;
$values[$index] = $resolver->resolve($prototypeValue);
}
$value = $values;
} else {
$value = $resolver->resolve($value);
}
} finally {
$resolver->prototypeIndex = null;
unset($this->calling[$option]);
}
}
@ -1286,6 +1339,10 @@ class OptionsResolver implements Options
$prefix .= sprintf('[%s]', implode('][', $this->parentsOptions));
}
if ($this->prototype && null !== $this->prototypeIndex) {
$prefix .= sprintf('[%s]', $this->prototypeIndex);
}
$options = array_map(static function (string $option) use ($prefix): string {
return sprintf('%s[%s]', $prefix, $option);
}, $options);

View file

@ -8,8 +8,8 @@ value), normalization and more.
Resources
---------
* [Documentation](https://symfony.com/doc/current/components/options_resolver.html)
* [Contributing](https://symfony.com/doc/current/contributing/index.html)
* [Report issues](https://github.com/symfony/symfony/issues) and
[send Pull Requests](https://github.com/symfony/symfony/pulls)
in the [main Symfony repository](https://github.com/symfony/symfony)
* [Documentation](https://symfony.com/doc/current/components/options_resolver.html)
* [Contributing](https://symfony.com/doc/current/contributing/index.html)
* [Report issues](https://github.com/symfony/symfony/issues) and
[send Pull Requests](https://github.com/symfony/symfony/pulls)
in the [main Symfony repository](https://github.com/symfony/symfony)

View file

@ -0,0 +1,292 @@
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\OptionsResolver\Tests\Debug;
use PHPUnit\Framework\TestCase;
use Symfony\Component\OptionsResolver\Debug\OptionsResolverIntrospector;
use Symfony\Component\OptionsResolver\Exception\NoConfigurationException;
use Symfony\Component\OptionsResolver\Exception\UndefinedOptionsException;
use Symfony\Component\OptionsResolver\Options;
use Symfony\Component\OptionsResolver\OptionsResolver;
class OptionsResolverIntrospectorTest extends TestCase
{
public function testGetDefault()
{
$resolver = new OptionsResolver();
$resolver->setDefault($option = 'foo', 'bar');
$debug = new OptionsResolverIntrospector($resolver);
$this->assertSame('bar', $debug->getDefault($option));
}
public function testGetDefaultNull()
{
$resolver = new OptionsResolver();
$resolver->setDefault($option = 'foo', null);
$debug = new OptionsResolverIntrospector($resolver);
$this->assertNull($debug->getDefault($option));
}
public function testGetDefaultThrowsOnNoConfiguredValue()
{
$this->expectException(NoConfigurationException::class);
$this->expectExceptionMessage('No default value was set for the "foo" option.');
$resolver = new OptionsResolver();
$resolver->setDefined($option = 'foo');
$debug = new OptionsResolverIntrospector($resolver);
$debug->getDefault($option);
}
public function testGetDefaultThrowsOnNotDefinedOption()
{
$this->expectException(UndefinedOptionsException::class);
$this->expectExceptionMessage('The option "foo" does not exist.');
$resolver = new OptionsResolver();
$debug = new OptionsResolverIntrospector($resolver);
$debug->getDefault('foo');
}
public function testGetLazyClosures()
{
$resolver = new OptionsResolver();
$closures = [];
$resolver->setDefault($option = 'foo', $closures[] = function (Options $options) {});
$debug = new OptionsResolverIntrospector($resolver);
$this->assertSame($closures, $debug->getLazyClosures($option));
}
public function testGetLazyClosuresThrowsOnNoConfiguredValue()
{
$this->expectException(NoConfigurationException::class);
$this->expectExceptionMessage('No lazy closures were set for the "foo" option.');
$resolver = new OptionsResolver();
$resolver->setDefined($option = 'foo');
$debug = new OptionsResolverIntrospector($resolver);
$debug->getLazyClosures($option);
}
public function testGetLazyClosuresThrowsOnNotDefinedOption()
{
$this->expectException(UndefinedOptionsException::class);
$this->expectExceptionMessage('The option "foo" does not exist.');
$resolver = new OptionsResolver();
$debug = new OptionsResolverIntrospector($resolver);
$debug->getLazyClosures('foo');
}
public function testGetAllowedTypes()
{
$resolver = new OptionsResolver();
$resolver->setDefined($option = 'foo');
$resolver->setAllowedTypes($option = 'foo', $allowedTypes = ['string', 'bool']);
$debug = new OptionsResolverIntrospector($resolver);
$this->assertSame($allowedTypes, $debug->getAllowedTypes($option));
}
public function testGetAllowedTypesThrowsOnNoConfiguredValue()
{
$this->expectException(NoConfigurationException::class);
$this->expectExceptionMessage('No allowed types were set for the "foo" option.');
$resolver = new OptionsResolver();
$resolver->setDefined($option = 'foo');
$debug = new OptionsResolverIntrospector($resolver);
$this->assertSame('bar', $debug->getAllowedTypes($option));
}
public function testGetAllowedTypesThrowsOnNotDefinedOption()
{
$this->expectException(UndefinedOptionsException::class);
$this->expectExceptionMessage('The option "foo" does not exist.');
$resolver = new OptionsResolver();
$debug = new OptionsResolverIntrospector($resolver);
$this->assertSame('bar', $debug->getAllowedTypes('foo'));
}
public function testGetAllowedValues()
{
$resolver = new OptionsResolver();
$resolver->setDefined($option = 'foo');
$resolver->setAllowedValues($option = 'foo', $allowedValues = ['bar', 'baz']);
$debug = new OptionsResolverIntrospector($resolver);
$this->assertSame($allowedValues, $debug->getAllowedValues($option));
}
public function testGetAllowedValuesThrowsOnNoConfiguredValue()
{
$this->expectException(NoConfigurationException::class);
$this->expectExceptionMessage('No allowed values were set for the "foo" option.');
$resolver = new OptionsResolver();
$resolver->setDefined($option = 'foo');
$debug = new OptionsResolverIntrospector($resolver);
$this->assertSame('bar', $debug->getAllowedValues($option));
}
public function testGetAllowedValuesThrowsOnNotDefinedOption()
{
$this->expectException(UndefinedOptionsException::class);
$this->expectExceptionMessage('The option "foo" does not exist.');
$resolver = new OptionsResolver();
$debug = new OptionsResolverIntrospector($resolver);
$this->assertSame('bar', $debug->getAllowedValues('foo'));
}
public function testGetNormalizer()
{
$resolver = new OptionsResolver();
$resolver->setDefined($option = 'foo');
$resolver->setNormalizer($option = 'foo', $normalizer = function () {});
$debug = new OptionsResolverIntrospector($resolver);
$this->assertSame($normalizer, $debug->getNormalizer($option));
}
public function testGetNormalizerThrowsOnNoConfiguredValue()
{
$this->expectException(NoConfigurationException::class);
$this->expectExceptionMessage('No normalizer was set for the "foo" option.');
$resolver = new OptionsResolver();
$resolver->setDefined($option = 'foo');
$debug = new OptionsResolverIntrospector($resolver);
$this->assertSame('bar', $debug->getNormalizer($option));
}
public function testGetNormalizerThrowsOnNotDefinedOption()
{
$this->expectException(UndefinedOptionsException::class);
$this->expectExceptionMessage('The option "foo" does not exist.');
$resolver = new OptionsResolver();
$debug = new OptionsResolverIntrospector($resolver);
$this->assertSame('bar', $debug->getNormalizer('foo'));
}
public function testGetNormalizers()
{
$resolver = new OptionsResolver();
$resolver->setDefined('foo');
$resolver->addNormalizer('foo', $normalizer1 = function () {});
$resolver->addNormalizer('foo', $normalizer2 = function () {});
$debug = new OptionsResolverIntrospector($resolver);
$this->assertSame([$normalizer1, $normalizer2], $debug->getNormalizers('foo'));
}
public function testGetNormalizersThrowsOnNoConfiguredValue()
{
$this->expectException(NoConfigurationException::class);
$this->expectExceptionMessage('No normalizer was set for the "foo" option.');
$resolver = new OptionsResolver();
$resolver->setDefined('foo');
$debug = new OptionsResolverIntrospector($resolver);
$debug->getNormalizers('foo');
}
public function testGetNormalizersThrowsOnNotDefinedOption()
{
$this->expectException(UndefinedOptionsException::class);
$this->expectExceptionMessage('The option "foo" does not exist.');
$resolver = new OptionsResolver();
$debug = new OptionsResolverIntrospector($resolver);
$debug->getNormalizers('foo');
}
/**
* @group legacy
*/
public function testGetDeprecationMessage()
{
$resolver = new OptionsResolver();
$resolver->setDefined('foo');
$resolver->setDeprecated('foo', 'The option "foo" is deprecated.');
$debug = new OptionsResolverIntrospector($resolver);
$this->assertSame('The option "foo" is deprecated.', $debug->getDeprecationMessage('foo'));
}
/**
* @group legacy
*/
public function testGetClosureDeprecationMessage()
{
$resolver = new OptionsResolver();
$resolver->setDefined('foo');
$resolver->setDeprecated('foo', $closure = function (Options $options, $value) {});
$debug = new OptionsResolverIntrospector($resolver);
$this->assertSame($closure, $debug->getDeprecationMessage('foo'));
}
public function testGetDeprecation()
{
$resolver = new OptionsResolver();
$resolver->setDefined('foo');
$resolver->setDeprecated('foo', 'vendor/package', '1.1', 'The option "foo" is deprecated.');
$debug = new OptionsResolverIntrospector($resolver);
$this->assertSame([
'package' => 'vendor/package',
'version' => '1.1',
'message' => 'The option "foo" is deprecated.',
], $debug->getDeprecation('foo'));
}
public function testGetClosureDeprecation()
{
$resolver = new OptionsResolver();
$resolver->setDefined('foo');
$resolver->setDeprecated('foo', 'vendor/package', '1.1', $closure = function (Options $options, $value) {});
$debug = new OptionsResolverIntrospector($resolver);
$this->assertSame([
'package' => 'vendor/package',
'version' => '1.1',
'message' => $closure,
], $debug->getDeprecation('foo'));
}
public function testGetDeprecationMessageThrowsOnNoConfiguredValue()
{
$this->expectException(NoConfigurationException::class);
$this->expectExceptionMessage('No deprecation was set for the "foo" option.');
$resolver = new OptionsResolver();
$resolver->setDefined('foo');
$debug = new OptionsResolverIntrospector($resolver);
$debug->getDeprecation('foo');
}
public function testGetDeprecationMessageThrowsOnNotDefinedOption()
{
$this->expectException(UndefinedOptionsException::class);
$this->expectExceptionMessage('The option "foo" does not exist.');
$resolver = new OptionsResolver();
$debug = new OptionsResolverIntrospector($resolver);
$debug->getDeprecation('foo');
}
}

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/5.2/phpunit.xsd"
backupGlobals="false"
colors="true"
bootstrap="vendor/autoload.php"
failOnRisky="true"
failOnWarning="true"
>
<php>
<ini name="error_reporting" value="-1" />
</php>
<testsuites>
<testsuite name="Symfony OptionsResolver Component Test Suite">
<directory>./Tests/</directory>
</testsuite>
</testsuites>
<filter>
<whitelist>
<directory>./</directory>
<exclude>
<directory>./Resources</directory>
<directory>./Tests</directory>
<directory>./vendor</directory>
</exclude>
</whitelist>
</filter>
</phpunit>

View file

@ -28,7 +28,7 @@
"minimum-stability": "dev",
"extra": {
"branch-alias": {
"dev-main": "1.22-dev"
"dev-main": "1.23-dev"
},
"thanks": {
"name": "symfony/polyfill",

View file

@ -26,7 +26,7 @@
"minimum-stability": "dev",
"extra": {
"branch-alias": {
"dev-main": "1.22-dev"
"dev-main": "1.23-dev"
},
"thanks": {
"name": "symfony/polyfill",

View file

@ -30,7 +30,7 @@
"minimum-stability": "dev",
"extra": {
"branch-alias": {
"dev-main": "1.22-dev"
"dev-main": "1.23-dev"
},
"thanks": {
"name": "symfony/polyfill",

View file

@ -6,8 +6,8 @@ The Process component executes commands in sub-processes.
Resources
---------
* [Documentation](https://symfony.com/doc/current/components/process.html)
* [Contributing](https://symfony.com/doc/current/contributing/index.html)
* [Report issues](https://github.com/symfony/symfony/issues) and
[send Pull Requests](https://github.com/symfony/symfony/pulls)
in the [main Symfony repository](https://github.com/symfony/symfony)
* [Documentation](https://symfony.com/doc/current/components/process.html)
* [Contributing](https://symfony.com/doc/current/contributing/index.html)
* [Report issues](https://github.com/symfony/symfony/issues) and
[send Pull Requests](https://github.com/symfony/symfony/pulls)
in the [main Symfony repository](https://github.com/symfony/symfony)

19
view/pl/cert_bad_eml.tpl Normal file
View file

@ -0,0 +1,19 @@
Jest to komunikat serwera internetowego na {{$sitename}};
Rutynowa kontrola wskazuje, że certyfikat SSL dla tego portalu jest
nieważny. Twój portal nie może w pełni uczestniczyć w sieci Zot
dopóki ten problem nie zostanie rozwiązany. Sprawdź swój certyfikat i swój
dostawca certyfikatu lub usługodawca, aby upewnić się, że jest on "prawidłowy
dla przeglądarki” i prawidłowo zainstalowany. Certyfikaty z podpisem własnym NIE
SĄ OBSŁUGIWANE i NIE DOZWOLONE w sieci Zot.
Sprawdzanie odbywa się poprzez pobranie adresu URL z Twojej witryny z włączoną
opcją ścisłego sprawdzania SSL, a jeśli to się nie powiedzie, ponowne sprawdzenie
z wyłaczona opcją kontroli SSL. Możliwe, że mogło to być spowodowane przejściowym
błędem, ale jeśli ostatnio wprowadzono zmiany w konfiguracji, lub jeśli otrzymujesz
tę wiadomość więcej niż jeden raz, sprawdź swój certyfikat.
Komunikat błędu brzmi: '{{$error}}'.
Przepraszamy za utrudnienia,
Twój serwer internetowy na {{$siteurl}}

15
view/pl/cron_bad_eml.tpl Normal file
View file

@ -0,0 +1,15 @@
Jest to komunikat serwera internetowego portalu {{$sitename}};
Rutynowa kontrola wskazuje, że zaplanowane zadania konserwacyjne w tym portalu
nie działają. Przejrzyj swoje zadania "cron" lub równoważnego mechanizm w Twoim
systemie operacyjnym i upewnij się, że są one uruchomione. Jeśli widzisz ten
komunikat po raz pierwszy, przejrzyj instrukcje w pliku INSTALL. Jeśli te zadania
konserwacyjne do tej pory działały normalnie, proszę sprawdzić, czy w międzuczasie
coś poszło nie tak. Ta kontrola jest przeprowadzana mniej więcej co trzy dni.
Komunikat błędu brzmi: '{{$error}}'.
Ostatnim udanym wykonaniem było '{{$lastdate}}'.
Przepraszamy za utrudnienia,
Twój serwer internetowy na {{$siteurl}}

115
view/pl/htconfig.tpl Normal file
View file

@ -0,0 +1,115 @@
<?php
// Ustaw następujące parametry dla instalacji bazy danych
// Skopiuj lub zmień nazwę tego pliku na .htconfig.php
$db_host = '{{$dbhost}}';
$db_port = '{{$dbport}}';
$db_user = '{{$dbuser}}';
$db_pass = '{{$dbpass}}';
$db_data = '{{$dbdata}}';
$db_type = '{{$dbtype}}'; // an integer. 0 or unset for mysql, 1 for postgres
{{$servertype}}
/*
* Uwaga: wiele z poniższych ustawień będzie dostępnych w panelu administracyjnym
* po udanej instalacji witryny. Gdy zostaną ustawione w panelu administracyjnym,
* są przechowywane w bazie danych - a ustawienie bazy danych zastąpią wszelkie
* odpowiadające im ustawienie w tym pliku
*
* Narzędzie wiersza poleceń util/config może wyszukiwać i ustawiać bezpośrednio
* elementy bazy danych, jeśli z jakiegoś powodu panel administracyjny nie jest
* dostępny a ustawienie systemu wymaga modyfikacji.
*
*/
// Wybierz poprawną strefę czasową. Jeśli nie masz pewności, użyj "Europe/Warsaw".
// Można to bedzie później zmienić i dotyczy to tylko sygnatur czasowych aninimowych oglądających
App::$config['system']['timezone'] = '{{$timezone}}';
// Jaki jest URL twojego portalu? NE DODAWAJ KOŃCOWEGO UKOŚNIKA
App::$config['system']['baseurl'] = '{{$siteurl}}';
App::$config['system']['sitename'] = '{{$platform}}';
App::$config['system']['location_hash'] = '{{$site_id}}';
// Te wiersze ustawiają dodatkowe nagłówki bezpieczeństwa, które mają być wysyłane
// ze wszystkimi odpowiedziami. Możesz ustawić transport_security_header na 0,
// jeśli twój serwer już wysyła ten nagłówek. Opcja content_security_policy może
// wymagać wyłączenia, jeśli chcesz uruchomić wtyczkę analityczną piwik lub umieścić
// na stronie inne zasoby poza witryną.
App::$config['system']['transport_security_header'] = 1;
App::$config['system']['content_security_policy'] = 1;
App::$config['system']['ssl_cookie_protection'] = 1;
// Masz do wyboru REGISTER_OPEN, REGISTER_APPROVE lub REGISTER_CLOSED.
// Pamiętaj, aby utworzyć własne konto osobiste przed ustawieniem
// REGISTE_CLOSED. Opcka 'register_text' (jeśli jest ustawionya) spowoduje
// wyświetlanie tego tekstu w widocznym miejscu na stronie rejestracji.
// REGISTER_APPROVE wymaga ustawienia 'admin_email' na adres e-mail już
// zarejestrowanej osoby, która może autoryzować i/lub zatwierdź/odrzuć wniosek.
App::$config['system']['register_policy'] = REGISTER_OPEN;
App::$config['system']['register_text'] = '';
App::$config['system']['admin_email'] = '{{$adminmail}}';
// Zalecamy pozostawienie tego ustawienia na 1. Ustaw na 0, aby umożliwić
// rejestrowanie się bez konieczności potwierdzania rejestracji w wiadomości
// e-mail wysyłanej na podany adres e-mail.
App::$config['system']['verify_email'] = 1;
// Ograniczenia dostępu do portalu. Domyślnie tworzone są portale prywatne.
// Masz do wyboru ACCESS_PRIVATE, ACCESS_PAID, ACCESS_TIERED i ACCESS_FREE.
// Jeśli pozostawisz ustawienie REGISTER_OPEN powyżej, każdy bedzie się mógł
// zarejestrować na Twoim portalu, jednak portal ten nie będzie nigdzie
// wyświetlany jako witryna z otwartą resjestracją.
// Używamy polityki dostępu do systemu (poniżej) aby określić, czy portal ma być
// umieszczony w katalogu jako portal otwarty, w którym każdy może tworzyć konta.
// Twój inny wybór to: paid, tiered lub free.
App::$config['system']['access_policy'] = ACCESS_PRIVATE;
// Jeśli prowadzisz portal publiczny, możesz zezwolić, aby osoby były kierowane
// do "strony sprzedaży", na której można szczegółowo opisać funkcje, zasady lub
// plany usług. To musi być bezwzględny adres URL zaczynający się od http:// lub
// https: //.
App::$config['system']['sellpage'] = '';
// Maksymalny rozmiar importowanej wiadomości, 0 to brak ograniczeń
App::$config['system']['max_import_size'] = 200000;
// Lokalizacja procesora wiersza poleceń PHP (CLI PHP)
App::$config['system']['php_path'] = '{{$phpath}}';
// Skonfiguruj sposób komunikacji z serwerami katalogowymi.
// DIRECTORY_MODE_NORMAL = klient katalogu, znajdziemy katalog
// DIRECTORY_MODE_SECONDARY = buforowanie katalogu lub kopii lustrzanej
// DIRECTORY_MODE_PRIMARY = główny serwer katalogów - jeden na dziedzinę
// DIRECTORY_MODE_STANDALONE = "poza siecią" lub prywatne usługi katalogowe
App::$config['system']['directory_mode'] = DIRECTORY_MODE_NORMAL;
// domyślny motyw systemowy
App::$config['system']['theme'] = 'redbasic';
// Konfiguracja rejstracji błędów PHP.
// Zanim to zrobisz, upewnij się, że serwer WWW ma uprawnienia
// tworzenie i zapisywanie php.out w katalogu WWW najwyższego poziomu,
// lub zmień nazwę (poniżej) na plik lub ścieżkę, jeśli jest to dozwolone.
ini_set('display_errors', '0');
// Odkomentuj poniższe linie, aby włączyć rejestrację błędów PHP.
//error_reporting(E_ERROR | E_PARSE );
//ini_set('error_log','php.out');
//ini_set('log_errors','1');

33
view/pl/lostpass_eml.tpl Normal file
View file

@ -0,0 +1,33 @@
DDrogi/Droga {{$username}},
Niedawno otrzymaliśmy prośbę o zresetowanie hasła do konta na {{$ sitename}}.
Aby potwierdzić tę prośbę, wybierz link weryfikacyjny poniżej lub wklej go w pasku
adresu przeglądarki internetowej.
Jeśli jest to pomyłka i nie chcesz zmieniać hasła, NIE klikaj podanego linku i
zignoruj albo usuń tą wiadomość e-mail.
Twoje hasło nie zostanie zmienione, chyba że potwierdzisz prawdziwość tego żądania.
Kliknij ten link, aby zweryfikować swoją tożsamość i potwierdzić żądanie zmiany hasła:
{{$reset_link}}
Następnie otrzymasz wiadomość uzupełniającą. która zawiera nowe hasło.
Możesz zmienić to hasło na stronie ustawień konta, po zalogowaniu się.
Dane logowania są następujące:
Lokalizacja serwisu: {{$siteurl}}
Nazwa logowania: {{$email}}
Z poważaniem,
{{$sitename}} Administrator
--
Warunki świadczenia usług:
{{$siteurl}}/help/pl/TermsOfService

BIN
view/pl/messages.mo Normal file

Binary file not shown.

13070
view/pl/messages.po Normal file

File diff suppressed because it is too large Load diff

12153
view/pl/messages.pot Normal file

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,21 @@
Drogi/Droga {{$username}},
Twoje hasło zostało zmienione zgodnie z żądaniem. Zachowaj te informacje
w swojej dokumentacji (lub natychmiast zmień swoje hasło na coś, co zapamiętasz).
Twoje dane logowania są następujące:
Lokalizacja serwisu: {{$siteurl}}
Nazwa logowania: {{$email}}
Hasło: {{$new_password}}
Możesz zmienić to hasło na stronie ustawień konta, po zalogowaniu się.
Z poważaniem,
{{$sitename}} Administrator
--
Warunki świadczenia usług:
{{$siteurl}}/help/TermsOfService

View file

@ -0,0 +1,16 @@
Na portalu {{$ sitename}} zostało utworzone konto dla tego adresu e-mail.
Dane logowania są następujące:
Lokalizacja serwisu: {{$siteurl}}
Login: {{$email}}
Hasło: (hasło, które zostało podane podczas rejestracji)
Jeśli to konto zostało utworzone bez Twojej wiedzy i nie jest pożądane, możesz
odwiedić nasz serwis i zresetować ustawione hasło. Umożliwi to usunięcie konta
linkiem na stronie "Ustawienia", a my przepraszamy za wszelkie niedogodności.
Dziękujemy i witamu na serwisie {{$sitename}}.
Z poważaniem,
{{$sitename}} Administrator

View file

@ -0,0 +1,24 @@
Otrzymaliśmy prośbę o rejestrację użytkownika na serwisie {{$ sitename}}, co
wymaga Twojej zgody.
Szczegóły logowania są następujące:
Lokalizacja serwisu: {{$siteurl}}
Nazwa logowania: {{$email}}
Adres IP: {{$details}}
Aby zatwierdzić tę prośbę, kliknij poniższy link:
{{$siteurl}}/regmod/allow/{{$hash}}
Aby odrzucić prośbę i usunąć konto, odwiedź:
{{$siteurl}}/regmod/deny/{{$hash}}
Dziękujemy.

View file

@ -0,0 +1,33 @@
Dziękujemy za zarejestrowanie się na serwisie {{$sitename}}.
Szczegóły Twojego logowania są następujące:
Lokalizacja serwisu: {{$siteurl}}
Nazwa logowania: {{$email}}
Zaloguj się za pomocą hasła wybranego podczas rejestracji.
Musimy zweryfikować Twój adres e-mail, aby zapewnić Ci pełny dostęp.
Twój kod weryfikacyjny, to:
{{$hash}}
Jeśli zarejestrowałeś to konto, wprowadź kod weryfikacyjny do żądania lub odwiedź
poniższy link:
{{$siteurl}}/regver/allow/{{$hash}}
Aby odrzucić rejestrację i usunąć konto, odwiedź:
{{$siteurl}}/regver/deny/{{$hash}}
Dziękjemy.
--
Warunki świadczenia usług:
{{$siteurl}}/help/TermsOfService

2784
view/pl/strings.php Normal file

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,22 @@
Przepraszamy, ale to może być ważne.
Jest to komunikat wygenerowany przez serwer WWW na {{$sitename}};
Twórcy projektu opublikowali niedawno aktualizację {{$update}},
ale podczas próby automatycznej instalacji coś poszło nie tak.
Należy to szybko naprawić i wymaga interwencji człowieka.
Skontaktuj się z deweloperem projektu, jeśli nie wiesz, jak samemu
naprawić ten problem. Konfiguracja bazy danych serwera WWW może być nieprawidłowa.
Komunikat błędu, to '{{$error}}'.
Możesz spróbować ponownie zastosować tę aktualizację, odwiedzając stronę
{{$baseurl}}/admin/dbsync
po zalogowaniu się na konto administratora.
{{$source}}
Przepraszam za utrudnienia,
Twój serwer WWW na {{$siteurl}}

View file

@ -66,10 +66,10 @@
<label id="photo-edit-caption-label" for="photo-edit-caption">{{$edit.capt_label}}</label>
<input id="photo-edit-caption" class="form-control" type="text" name="desc" value="{{$edit.caption}}" />
</div>
<div class="form-group">
{{* <div class="form-group">
<label id="photo-edit-tags-label" for="photo-edit-newtag">{{$edit.tag_label}}</label>
<input name="newtag" id="photo-edit-newtag" class="form-control" title="{{$edit.help_tags}}" type="text" />
</div>
</div> *}}
<div class="form-group">
{{include file="field_select.tpl" field=$edit.album_select}}
</div>