diff options
Diffstat (limited to 'Zotlabs/Module')
-rw-r--r-- | Zotlabs/Module/Acl.php | 55 | ||||
-rw-r--r-- | Zotlabs/Module/Channel.php | 3 | ||||
-rw-r--r-- | Zotlabs/Module/Chat.php | 13 | ||||
-rw-r--r-- | Zotlabs/Module/Connedit.php | 33 | ||||
-rw-r--r-- | Zotlabs/Module/Display.php | 1 | ||||
-rw-r--r-- | Zotlabs/Module/Editwebpage.php | 1 | ||||
-rw-r--r-- | Zotlabs/Module/Embedphotos.php | 12 | ||||
-rw-r--r-- | Zotlabs/Module/Events.php | 12 | ||||
-rw-r--r-- | Zotlabs/Module/File_upload.php | 45 | ||||
-rw-r--r-- | Zotlabs/Module/Filestorage.php | 8 | ||||
-rw-r--r-- | Zotlabs/Module/Impel.php | 4 | ||||
-rw-r--r-- | Zotlabs/Module/Like.php | 2 | ||||
-rw-r--r-- | Zotlabs/Module/Menu.php | 6 | ||||
-rw-r--r-- | Zotlabs/Module/Mitem.php | 10 | ||||
-rw-r--r-- | Zotlabs/Module/Network.php | 1 | ||||
-rw-r--r-- | Zotlabs/Module/Photos.php | 10 | ||||
-rw-r--r-- | Zotlabs/Module/Rate.php | 2 | ||||
-rw-r--r-- | Zotlabs/Module/Register.php | 11 | ||||
-rw-r--r-- | Zotlabs/Module/Rpost.php | 2 | ||||
-rw-r--r-- | Zotlabs/Module/Settings.php | 138 | ||||
-rw-r--r-- | Zotlabs/Module/Setup.php | 24 | ||||
-rw-r--r-- | Zotlabs/Module/Thing.php | 8 | ||||
-rw-r--r-- | Zotlabs/Module/Webpages.php | 186 | ||||
-rw-r--r-- | Zotlabs/Module/Wiki.php | 22 |
24 files changed, 112 insertions, 497 deletions
diff --git a/Zotlabs/Module/Acl.php b/Zotlabs/Module/Acl.php index 8c62f4de9..76a001fdd 100644 --- a/Zotlabs/Module/Acl.php +++ b/Zotlabs/Module/Acl.php @@ -58,24 +58,7 @@ class Acl extends \Zotlabs\Web\Controller { if( (! local_channel()) && (! ($type == 'x' || $type == 'c'))) killme(); - - $permitted = []; - - if(in_array($type, [ 'm', 'a', 'c' ])) { - - // These queries require permission checking. We'll create a simple array of xchan_hash for those with - // the requisite permissions which we can check against. - - $x = q("select xchan from abconfig where chan = %d and cat = 'their_perms' and k = '%s' and v = 1", - intval(local_channel()), - dbesc(($type === 'm') ? 'post_mail' : 'tag_deliver') - ); - - $permitted = ids_to_array($x,'xchan'); - - } - - + if($search) { $sql_extra = " AND `name` LIKE " . protect_sprintf( "'%" . dbesc($search) . "%'" ) . " "; $sql_extra2 = "AND ( xchan_name LIKE " . protect_sprintf( "'%" . dbesc($search) . "%'" ) . " OR xchan_addr LIKE " . protect_sprintf( "'%" . dbesc($search) . ((strpos($search,'@') === false) ? "%@%'" : "%'")) . ") "; @@ -104,13 +87,13 @@ class Acl extends \Zotlabs\Web\Controller { if($type == '' || $type == 'g') { - $r = q("SELECT groups.id, groups.hash, groups.gname - FROM groups,group_member - WHERE groups.deleted = 0 AND groups.uid = %d - AND group_member.gid=groups.id + $r = q("SELECT `groups`.`id`, `groups`.`hash`, `groups`.`gname` + FROM `groups`,`group_member` + WHERE `groups`.`deleted` = 0 AND `groups`.`uid` = %d + AND `group_member`.`gid`=`groups`.`id` $sql_extra - GROUP BY groups.id - ORDER BY groups.gname + GROUP BY `groups`.`id` + ORDER BY `groups`.`gname` LIMIT %d OFFSET %d", intval(local_channel()), intval($count), @@ -173,7 +156,7 @@ class Acl extends \Zotlabs\Web\Controller { } - $r = q("SELECT abook_id as id, xchan_hash as hash, xchan_name as name, xchan_photo_s as micro, xchan_url as url, xchan_addr as nick, abook_their_perms, xchan_pubforum, abook_flags, abook_self + $r = q("SELECT abook_id as id, xchan_hash as hash, xchan_name as name, xchan_photo_s as micro, xchan_url as url, xchan_addr as nick, abook_their_perms, abook_flags, abook_self FROM abook left join xchan on abook_xchan = xchan_hash WHERE (abook_channel = %d $extra_channels_sql) AND abook_blocked = 0 and abook_pending = 0 and xchan_deleted = 0 $sql_extra2 order by $order_extra2 xchan_name asc" , intval(local_channel()) @@ -238,24 +221,16 @@ class Acl extends \Zotlabs\Web\Controller { } } elseif($type == 'm') { - - $r = array(); - $z = q("SELECT xchan_hash as hash, xchan_name as name, xchan_addr as nick, xchan_photo_s as micro, xchan_url as url + + $r = q("SELECT xchan_hash as hash, xchan_name as name, xchan_addr as nick, xchan_photo_s as micro, xchan_url as url FROM abook left join xchan on abook_xchan = xchan_hash - WHERE abook_channel = %d + WHERE abook_channel = %d and ( (abook_their_perms = null) or (abook_their_perms & %d )>0) and xchan_deleted = 0 $sql_extra3 - ORDER BY xchan_name ASC ", - intval(local_channel()) + ORDER BY `xchan_name` ASC ", + intval(local_channel()), + intval(PERMS_W_MAIL) ); - if($z) { - foreach($z as $zz) { - if(in_array($zz['hash'],$permitted)) { - $r[] = $zz; - } - } - } - } elseif($type == 'a') { @@ -299,7 +274,7 @@ class Acl extends \Zotlabs\Web\Controller { if(strpos($g['hash'],'/') && $type != 'a') continue; - if(in_array($g['hash'],$permitted) && $type == 'c' && (! $noforums)) { + if(($g['abook_their_perms'] & PERMS_W_TAGWALL) && $type == 'c' && (! $noforums)) { $contacts[] = array( "type" => "c", "photo" => "images/twopeople.png", diff --git a/Zotlabs/Module/Channel.php b/Zotlabs/Module/Channel.php index 59cb9f06c..c74802ec5 100644 --- a/Zotlabs/Module/Channel.php +++ b/Zotlabs/Module/Channel.php @@ -133,7 +133,6 @@ class Channel extends \Zotlabs\Web\Controller { 'nickname' => \App::$profile['channel_address'], 'lockstate' => (((strlen(\App::$profile['channel_allow_cid'])) || (strlen(\App::$profile['channel_allow_gid'])) || (strlen(\App::$profile['channel_deny_cid'])) || (strlen(\App::$profile['channel_deny_gid']))) ? 'lock' : 'unlock'), 'acl' => (($is_owner) ? populate_acl($channel_acl,true, \Zotlabs\Lib\PermissionDescription::fromGlobalPermission('view_stream'), get_post_aclDialogDescription(), 'acl_dialog_post') : ''), - 'permissions' => (($is_owner) ? $channel_acl : ''), 'showacl' => (($is_owner) ? 'yes' : ''), 'bang' => '', 'visitor' => (($is_owner || $observer) ? true : false), @@ -364,4 +363,4 @@ class Channel extends \Zotlabs\Web\Controller { return $o; } -} +}
\ No newline at end of file diff --git a/Zotlabs/Module/Chat.php b/Zotlabs/Module/Chat.php index 2c0e7a155..ff55a9319 100644 --- a/Zotlabs/Module/Chat.php +++ b/Zotlabs/Module/Chat.php @@ -218,13 +218,14 @@ class Chat extends \Zotlabs\Web\Controller { notice( t('Feature disabled.') . EOL); return $o; } - + + $acl = new \Zotlabs\Access\AccessList($channel); $channel_acl = $acl->get(); - + $lockstate = (($channel_acl['allow_cid'] || $channel_acl['allow_gid'] || $channel_acl['deny_cid'] || $channel_acl['deny_gid']) ? 'lock' : 'unlock'); require_once('include/acl_selectors.php'); - + $chatroom_new = ''; if(local_channel()) { $chatroom_new = replace_macros(get_markup_template('chatroom_new.tpl'),array( @@ -233,16 +234,12 @@ class Chat extends \Zotlabs\Web\Controller { '$chat_expire' => array('chat_expire',t('Expiration of chats (minutes)'),120,''), '$permissions' => t('Permissions'), '$acl' => populate_acl($channel_acl,false), - '$allow_cid' => acl2json($channel_acl['allow_cid']), - '$allow_gid' => acl2json($channel_acl['allow_gid']), - '$deny_cid' => acl2json($channel_acl['deny_cid']), - '$deny_gid' => acl2json($channel_acl['deny_gid']), '$lockstate' => $lockstate, '$submit' => t('Submit') )); } - + $rooms = Zlib\Chatroom::roomlist(\App::$profile['profile_uid']); $o .= replace_macros(get_markup_template('chatrooms.tpl'), array( diff --git a/Zotlabs/Module/Connedit.php b/Zotlabs/Module/Connedit.php index a5568c564..7db4950b1 100644 --- a/Zotlabs/Module/Connedit.php +++ b/Zotlabs/Module/Connedit.php @@ -137,16 +137,11 @@ class Connedit extends \Zotlabs\Web\Controller { $new_friend = false; - // only store a record and notify the directory if the rating changed - if(! $is_self) { $signed = $orig_record[0]['abook_xchan'] . '.' . $rating . '.' . $rating_text; - $sig = base64url_encode(rsa_sign($signed,$channel['channel_prvkey'])); - - $rated = ((intval($rating) || strlen($rating_text)) ? true : false); - $record = 0; + $sig = base64url_encode(rsa_sign($signed,$channel['channel_prvkey'])); $z = q("select * from xlink where xlink_xchan = '%s' and xlink_link = '%s' and xlink_static = 1 limit 1", dbesc($channel['channel_hash']), @@ -154,20 +149,17 @@ class Connedit extends \Zotlabs\Web\Controller { ); if($z) { - if(($z[0]['xlink_rating'] != $rating) || ($z[0]['xlink_rating_text'] != $rating_text)) { - $record = $z[0]['xlink_id']; - $w = q("update xlink set xlink_rating = '%d', xlink_rating_text = '%s', xlink_sig = '%s', xlink_updated = '%s' - where xlink_id = %d", - intval($rating), - dbesc($rating_text), - dbesc($sig), - dbesc(datetime_convert()), - intval($record) - ); - } + $record = $z[0]['xlink_id']; + $w = q("update xlink set xlink_rating = '%d', xlink_rating_text = '%s', xlink_sig = '%s', xlink_updated = '%s' + where xlink_id = %d", + intval($rating), + dbesc($rating_text), + dbesc($sig), + dbesc(datetime_convert()), + intval($record) + ); } - elseif($rated) { - // only create a record if there's something to save + else { $w = q("insert into xlink ( xlink_xchan, xlink_link, xlink_rating, xlink_rating_text, xlink_sig, xlink_updated, xlink_static ) values ( '%s', '%s', %d, '%s', '%s', '%s', 1 ) ", dbesc($channel['channel_hash']), dbesc($orig_record[0]['abook_xchan']), @@ -312,6 +304,9 @@ class Connedit extends \Zotlabs\Web\Controller { call_hooks('accept_follow', $arr); } + if(! is_null($autoperms)) + set_pconfig(local_channel(),'system','autoperms',(($autoperms) ? $abook_my_perms : 0)); + $this->connedit_clone($a); if(($_REQUEST['pending']) && (!$_REQUEST['done'])) diff --git a/Zotlabs/Module/Display.php b/Zotlabs/Module/Display.php index 35ed0c894..d1d4edc7d 100644 --- a/Zotlabs/Module/Display.php +++ b/Zotlabs/Module/Display.php @@ -65,7 +65,6 @@ class Display extends \Zotlabs\Web\Controller { 'lockstate' => (($group || $cid || $channel['channel_allow_cid'] || $channel['channel_allow_gid'] || $channel['channel_deny_cid'] || $channel['channel_deny_gid']) ? 'lock' : 'unlock'), 'acl' => populate_acl($channel_acl), - 'permissions' => $channel_acl, 'bang' => '', 'visitor' => true, 'profile_uid' => local_channel(), diff --git a/Zotlabs/Module/Editwebpage.php b/Zotlabs/Module/Editwebpage.php index 9803218d8..be4803a07 100644 --- a/Zotlabs/Module/Editwebpage.php +++ b/Zotlabs/Module/Editwebpage.php @@ -151,7 +151,6 @@ class Editwebpage extends \Zotlabs\Web\Controller { 'post_id' => $post_id, 'visitor' => ($is_owner) ? true : false, 'acl' => populate_acl($itm[0],false,\Zotlabs\Lib\PermissionDescription::fromGlobalPermission('view_pages')), - 'permissions' => $itm[0], 'showacl' => ($is_owner) ? true : false, 'mimetype' => $mimetype, 'mimeselect' => true, diff --git a/Zotlabs/Module/Embedphotos.php b/Zotlabs/Module/Embedphotos.php index 0dc745b0a..0dac873c5 100644 --- a/Zotlabs/Module/Embedphotos.php +++ b/Zotlabs/Module/Embedphotos.php @@ -39,9 +39,9 @@ class Embedphotos extends \Zotlabs\Web\Controller { json_return_and_die(array('errormsg' => 'Error retrieving link ' . $href, 'status' => false)); } $resource_id = array_pop(explode("/", $href)); - $r = q("SELECT obj,body from item where resource_type = 'photo' and resource_id = '%s' limit 1", - dbesc($resource_id) - ); + $r = q("SELECT obj from item where resource_type = 'photo' and resource_id = '%s' limit 1", + dbesc($resource_id) + ); if(!$r) { json_return_and_die(array('errormsg' => 'Error retrieving resource ' . $resource_id, 'status' => false)); } @@ -50,9 +50,7 @@ class Embedphotos extends \Zotlabs\Web\Controller { $photolink = $obj['body']; } elseif (x($obj,'bbcode')) { $photolink = $obj['bbcode']; - } elseif ($r[0]['body'] !== '') { - $photolink = $r[0]['body']; - } else { + } else { json_return_and_die(array('errormsg' => 'Error retrieving resource ' . $resource_id, 'status' => false)); } json_return_and_die(array('status' => true, 'photolink' => $photolink)); @@ -85,7 +83,7 @@ function embedphotos_widget_album($args) { return ''; if($args['album']) - $album = (($args['album'] === '/') ? '' : $args['album'] ); + $album = $args['album']; if($args['title']) $title = $args['title']; diff --git a/Zotlabs/Module/Events.php b/Zotlabs/Module/Events.php index d27de9989..def5c437b 100644 --- a/Zotlabs/Module/Events.php +++ b/Zotlabs/Module/Events.php @@ -435,10 +435,6 @@ class Events extends \Zotlabs\Web\Controller { $acl = new \Zotlabs\Access\AccessList($channel); $perm_defaults = $acl->get(); - - $permissions = ((x($orig_event)) ? $orig_event : $perm_defaults); - - //print_r(acl2json($permissions['allow_gid'])); killme(); $tpl = get_markup_template('event_form.tpl'); @@ -471,16 +467,10 @@ class Events extends \Zotlabs\Web\Controller { '$sh_checked' => $sh_checked, '$share' => array('share', t('Share this event'), $sh_checked, '', array(t('No'),t('Yes'))), '$preview' => t('Preview'), - '$perms_label' => t('Permission settings'), + '$permissions' => t('Permission settings'), // populating the acl dialog was a permission description from view_stream because Cal.php, which // displays events, says "since we don't currently have an event permission - use the stream permission" '$acl' => (($orig_event['event_xchan']) ? '' : populate_acl(((x($orig_event)) ? $orig_event : $perm_defaults), false, \Zotlabs\Lib\PermissionDescription::fromGlobalPermission('view_stream'))), - - '$allow_cid' => acl2json($permissions['allow_cid']), - '$allow_gid' => acl2json($permissions['allow_gid']), - '$deny_cid' => acl2json($permissions['deny_cid']), - '$deny_gid' => acl2json($permissions['deny_gid']), - '$submit' => t('Submit'), '$advanced' => t('Advanced Options') diff --git a/Zotlabs/Module/File_upload.php b/Zotlabs/Module/File_upload.php deleted file mode 100644 index d5c0c7e05..000000000 --- a/Zotlabs/Module/File_upload.php +++ /dev/null @@ -1,45 +0,0 @@ -<?php -namespace Zotlabs\Module; - -require_once('include/attach.php'); -require_once('include/channel.php'); -require_once('include/photos.php'); - - -class File_upload extends \Zotlabs\Web\Controller { - - function post() { - - // logger('file upload: ' . print_r($_REQUEST,true)); - - $channel = (($_REQUEST['channick']) ? get_channel_by_nick($_REQUEST['channick']) : null); - - if(! $channel) { - logger('channel not found'); - killme(); - } - - $_REQUEST['source'] = 'file_upload'; - - if($channel['channel_id'] != local_channel()) { - $_REQUEST['contact_allow'] = expand_acl($channel['channel_allow_cid']); - $_REQUEST['group_allow'] = expand_acl($channel['channel_allow_gid']); - $_REQUEST['contact_deny'] = expand_acl($channel['channel_deny_cid']); - $_REQUEST['group_deny'] = expand_acl($channel['channel_deny_gid']); - } - - if($_REQUEST['filename']) { - $_REQUEST['allow_cid'] = perms2str($_REQUEST['contact_allow']); - $_REQUEST['allow_gid'] = perms2str($_REQUEST['group_allow']); - $_REQUEST['deny_cid'] = perms2str($_REQUEST['contact_deny']); - $_REQUEST['deny_gid'] = perms2str($_REQUEST['group_deny']); - $r = attach_mkdir($channel,get_observer_hash(),$_REQUEST); - } - else { - $r = attach_store($channel,get_observer_hash(), '', $_REQUEST); - } - goaway(z_root() . '/' . $_REQUEST['return_url']); - - } - -} diff --git a/Zotlabs/Module/Filestorage.php b/Zotlabs/Module/Filestorage.php index a401f4822..c3ef22e32 100644 --- a/Zotlabs/Module/Filestorage.php +++ b/Zotlabs/Module/Filestorage.php @@ -141,7 +141,7 @@ class Filestorage extends \Zotlabs\Web\Controller { // Encode path that is used for link so it's a valid URL // Keep slashes as slashes, otherwise mod_rewrite doesn't work correctly $encoded_path = str_replace('%2F', '/', rawurlencode($cloudpath)); - + $o = replace_macros(get_markup_template('attach_edit.tpl'), array( '$header' => t('Edit file permissions'), '$file' => $f, @@ -151,10 +151,6 @@ class Filestorage extends \Zotlabs\Web\Controller { '$channelnick' => $channel['channel_address'], '$permissions' => t('Permissions'), '$aclselect' => $aclselect_e, - '$allow_cid' => acl2json($f['allow_cid']), - '$allow_gid' => acl2json($f['allow_gid']), - '$deny_cid' => acl2json($f['deny_cid']), - '$deny_gid' => acl2json($f['deny_gid']), '$lockstate' => $lockstate, '$permset' => t('Set/edit permissions'), '$recurse' => array('recurse', t('Include all files and sub folders'), 0, '', array(t('No'), t('Yes'))), @@ -165,7 +161,7 @@ class Filestorage extends \Zotlabs\Web\Controller { '$submit' => t('Submit'), '$attach_btn_title' => t('Share this file'), '$link_btn_title' => t('Show URL to this file'), - '$notify' => array('notify', t('Notify your contacts about this file'), 0, '', array(t('No'), t('Yes'))), + '$notify' => array('notify', t('Notify your contacts about this file'), 0, '', array(t('No'), t('Yes'))) )); echo $o; diff --git a/Zotlabs/Module/Impel.php b/Zotlabs/Module/Impel.php index 197d9f859..735c311d0 100644 --- a/Zotlabs/Module/Impel.php +++ b/Zotlabs/Module/Impel.php @@ -88,11 +88,7 @@ class Impel extends \Zotlabs\Web\Controller { foreach($j['items'] as $it) { $mitem = array(); - $mitem['mitem_link'] = str_replace('[channelurl]',z_root() . '/channel/' . $channel['channel_address'],$it['link']); - $mitem['mitem_link'] = str_replace('[pageurl]',z_root() . '/page/' . $channel['channel_address'],$it['link']); - $mitem['mitem_link'] = str_replace('[cloudurl]',z_root() . '/cloud/' . $channel['channel_address'],$it['link']); $mitem['mitem_link'] = str_replace('[baseurl]',z_root(),$it['link']); - $mitem['mitem_desc'] = escape_tags($it['desc']); $mitem['mitem_order'] = intval($it['order']); if(is_array($it['flags'])) { diff --git a/Zotlabs/Module/Like.php b/Zotlabs/Module/Like.php index fbb6c3c84..1ca37d646 100644 --- a/Zotlabs/Module/Like.php +++ b/Zotlabs/Module/Like.php @@ -496,8 +496,6 @@ class Like extends \Zotlabs\Web\Controller { $arr['deny_gid'] = $deny_gid; $arr['item_private'] = $private; - call_hooks('post_local',$arr); - $post = item_store($arr); $post_id = $post['item_id']; diff --git a/Zotlabs/Module/Menu.php b/Zotlabs/Module/Menu.php index 1dec65c1f..e98053f8c 100644 --- a/Zotlabs/Module/Menu.php +++ b/Zotlabs/Module/Menu.php @@ -65,7 +65,7 @@ class Menu extends \Zotlabs\Web\Controller { - function get() { + function get() { $uid = local_channel(); @@ -81,7 +81,7 @@ class Menu extends \Zotlabs\Web\Controller { if(argc() == 1) { - $channel = (($sys) ? $sys : \App::get_channel()); + // list menus $x = menu_list($uid); @@ -89,7 +89,7 @@ class Menu extends \Zotlabs\Web\Controller { for($y = 0; $y < count($x); $y ++) { $m = menu_fetch($x[$y]['menu_name'],$uid,get_observer_hash()); if($m) - $x[$y]['element'] = '[element]' . base64url_encode(json_encode(menu_element($channel,$m))) . '[/element]'; + $x[$y]['element'] = '[element]' . base64url_encode(json_encode(menu_element($m))) . '[/element]'; $x[$y]['bookmark'] = (($x[$y]['menu_flags'] & MENU_BOOKMARK) ? true : false); } } diff --git a/Zotlabs/Module/Mitem.php b/Zotlabs/Module/Mitem.php index 28f51b81b..b64b50c8e 100644 --- a/Zotlabs/Module/Mitem.php +++ b/Zotlabs/Module/Mitem.php @@ -147,16 +147,12 @@ class Mitem extends \Zotlabs\Web\Controller { else { $display = (($r) ? 'none' : 'block'); } - + $create = replace_macros(get_markup_template('mitemedit.tpl'), array( '$menu_id' => \App::$data['menu']['menu_id'], '$permissions' => t('Menu Item Permissions'), '$permdesc' => t("\x28click to open/close\x29"), '$aclselect' => populate_acl($acl->get(),false), - '$allow_cid' => acl2json($acl->get()['allow_cid']), - '$allow_gid' => acl2json($acl->get()['allow_gid']), - '$deny_cid' => acl2json($acl->get()['deny_cid']), - '$deny_gid' => acl2json($acl->get()['deny_gid']), '$mitem_desc' => array('mitem_desc', t('Link Name'), '', 'Visible name of the link','*'), '$mitem_link' => array('mitem_link', t('Link or Submenu Target'), '', t('Enter URL of the link or select a menu name to create a submenu'), '*', 'list="menu-names"'), '$usezid' => array('usezid', t('Use magic-auth if available'), true, '', array(t('No'), t('Yes'))), @@ -230,10 +226,6 @@ class Mitem extends \Zotlabs\Web\Controller { '$permissions' => t('Menu Item Permissions'), '$permdesc' => t("\x28click to open/close\x29"), '$aclselect' => populate_acl($mitem,false), - '$allow_cid' => acl2json($mitem['allow_cid']), - '$allow_gid' => acl2json($mitem['allow_gid']), - '$deny_cid' => acl2json($mitem['deny_cid']), - '$deny_gid' => acl2json($mitem['deny_gid']), '$mitem_id' => intval(argv(2)), '$mitem_desc' => array('mitem_desc', t('Link text'), $mitem['mitem_desc'], '','*'), '$mitem_link' => array('mitem_link', t('Link or Submenu Target'), $mitem['mitem_link'], 'Enter URL of the link or select a menu name to create a submenu', '*', 'list="menu-names"'), diff --git a/Zotlabs/Module/Network.php b/Zotlabs/Module/Network.php index 0128adc2c..3b88cd8d6 100644 --- a/Zotlabs/Module/Network.php +++ b/Zotlabs/Module/Network.php @@ -170,7 +170,6 @@ class Network extends \Zotlabs\Web\Controller { 'nickname' => $channel['channel_address'], 'lockstate' => (($private_editing || $channel['channel_allow_cid'] || $channel['channel_allow_gid'] || $channel['channel_deny_cid'] || $channel['channel_deny_gid']) ? 'lock' : 'unlock'), 'acl' => populate_acl((($private_editing) ? $def_acl : $channel_acl), true, \Zotlabs\Lib\PermissionDescription::fromGlobalPermission('view_stream'), get_post_aclDialogDescription(), 'acl_dialog_post'), - 'permissions' => (($private_editing) ? $def_acl : $channel_acl), 'bang' => (($private_editing) ? '!' : ''), 'visitor' => true, 'profile_uid' => local_channel(), diff --git a/Zotlabs/Module/Photos.php b/Zotlabs/Module/Photos.php index 6aeac7af7..1eeab1461 100644 --- a/Zotlabs/Module/Photos.php +++ b/Zotlabs/Module/Photos.php @@ -668,10 +668,6 @@ class Photos extends \Zotlabs\Web\Controller { '$selname' => $selname, '$permissions' => t('Permissions'), '$aclselect' => $aclselect, - '$allow_cid' => acl2json($channel_acl['allow_cid']), - '$allow_gid' => acl2json($channel_acl['allow_gid']), - '$deny_cid' => acl2json($channel_acl['deny_cid']), - '$deny_gid' => acl2json($channel_acl['deny_gid']), '$lockstate' => $lockstate, '$uploader' => $ret['addon_text'], '$default' => (($ret['default_upload']) ? true : false), @@ -1020,7 +1016,7 @@ class Photos extends \Zotlabs\Web\Controller { // FIXME - remove this when we move to conversation module $r = $r[0]['children']; - + $edit = null; if($can_post) { $album_e = $ph[0]['album']; @@ -1046,10 +1042,6 @@ class Photos extends \Zotlabs\Web\Controller { 'tag_label' => t('Add a Tag'), 'permissions' => t('Permissions'), 'aclselect' => $aclselect_e, - 'allow_cid' => acl2json($ph[0]['allow_cid']), - 'allow_gid' => acl2json($ph[0]['allow_gid']), - 'deny_cid' => acl2json($ph[0]['deny_cid']), - 'deny_gid' => acl2json($ph[0]['deny_gid']), 'lockstate' => $lockstate[0], 'help_tags' => t('Example: @bob, @Barbara_Jensen, @jim@example.com'), 'item_id' => ((count($linked_items)) ? $link_item['id'] : 0), diff --git a/Zotlabs/Module/Rate.php b/Zotlabs/Module/Rate.php index 2f769b36b..da23b840e 100644 --- a/Zotlabs/Module/Rate.php +++ b/Zotlabs/Module/Rate.php @@ -43,7 +43,7 @@ class Rate extends \Zotlabs\Web\Controller { } - function post() { + function post() { if(! local_channel()) return; diff --git a/Zotlabs/Module/Register.php b/Zotlabs/Module/Register.php index 4cdd27001..45123b88d 100644 --- a/Zotlabs/Module/Register.php +++ b/Zotlabs/Module/Register.php @@ -151,7 +151,7 @@ class Register extends \Zotlabs\Web\Controller { $new_channel = false; $next_page = 'new_channel'; - if(get_config('system','auto_channel_create') || get_config('system','server_role') == 'basic') { + if(get_config('system','auto_channel_create') || UNO) { $new_channel = auto_channel_create($result['account']['account_id']); if($new_channel['success']) { $channel_id = $new_channel['channel']['channel_id']; @@ -234,12 +234,9 @@ class Register extends \Zotlabs\Web\Controller { $privacy_role = ((x($_REQUEST,'permissions_role')) ? $_REQUEST['permissions_role'] : ""); $role = array('permissions_role' , t('Channel role and privacy'), ($privacy_role) ? $privacy_role : 'social', t('Select a channel role with your privacy requirements.') . ' <a href="help/roles" target="_blank">' . t('Read more about roles') . '</a>',get_roles()); $tos = array('tos', $label_tos, '', '', array(t('no'),t('yes'))); - - $server_role = get_config('system','server_role'); - - - $auto_create = (($server_role == 'basic') || (get_config('system','auto_channel_create')) ? true : false); - $default_role = (($server_role == 'basic') ? 'social' : get_config('system','default_permissions_role')); + + $auto_create = ((UNO) || (get_config('system','auto_channel_create')) ? true : false); + $default_role = ((UNO) ? 'social' : get_config('system','default_permissions_role')); require_once('include/bbcode.php'); diff --git a/Zotlabs/Module/Rpost.php b/Zotlabs/Module/Rpost.php index 28a1f1bb0..9e3043d10 100644 --- a/Zotlabs/Module/Rpost.php +++ b/Zotlabs/Module/Rpost.php @@ -116,7 +116,6 @@ class Rpost extends \Zotlabs\Web\Controller { 'nickname' => $channel['channel_address'], 'lockstate' => (($acl->is_private()) ? 'lock' : 'unlock'), 'acl' => populate_acl($channel_acl, true, \Zotlabs\Lib\PermissionDescription::fromGlobalPermission('view_stream'), get_post_aclDialogDescription(), 'acl_dialog_post'), - 'permissions' => $channel_acl, 'bang' => '', 'visitor' => true, 'profile_uid' => local_channel(), @@ -126,7 +125,6 @@ class Rpost extends \Zotlabs\Web\Controller { 'source' => ((x($_REQUEST,'source')) ? strip_tags($_REQUEST['source']) : ''), 'return_path' => 'rpost/return', 'bbco_autocomplete' => 'bbcode', - 'editor_autocomplete'=> true, 'bbcode' => true ); diff --git a/Zotlabs/Module/Settings.php b/Zotlabs/Module/Settings.php index 12157944f..4e3de2c51 100644 --- a/Zotlabs/Module/Settings.php +++ b/Zotlabs/Module/Settings.php @@ -2,7 +2,7 @@ namespace Zotlabs\Module; /** @file */ require_once('include/zot.php'); -require_once('include/security.php'); + class Settings extends \Zotlabs\Web\Controller { @@ -21,7 +21,10 @@ class Settings extends \Zotlabs\Web\Controller { // We are setting these values - don't use the argc(), argv() functions here \App::$argc = 2; \App::$argv[] = 'channel'; - } + } + + + } @@ -35,7 +38,7 @@ class Settings extends \Zotlabs\Web\Controller { $channel = \App::get_channel(); - // logger('mod_settings: ' . print_r($_REQUEST,true)); + logger('mod_settings: ' . print_r($_REQUEST,true)); if((argc() > 1) && (argv(1) === 'oauth') && x($_POST,'remove')){ @@ -164,23 +167,7 @@ class Settings extends \Zotlabs\Web\Controller { dbesc($expires) ); } - - $atoken_xchan = substr($channel['channel_hash'],0,16) . '.' . $name; - - $all_perms = \Zotlabs\Access\Permissions::Perms(); - - if($all_perms) { - foreach($all_perms as $perm => $desc) { - if(array_key_exists('perms_' . $perm, $_POST)) { - set_abconfig($channel['channel_id'],$atoken_xchan,'my_perms',$perm,intval($_POST['perms_' . $perm])); - } - else { - set_abconfig($channel['channel_id'],$atoken_xchan,'my_perms',$perm,0); - } - } - } - info( t('Token saved.') . EOL); return; } @@ -286,7 +273,7 @@ class Settings extends \Zotlabs\Web\Controller { $email = ((x($_POST,'email')) ? trim(notags($_POST['email'])) : ''); $account = \App::get_account(); if($email != $account['account_email']) { - if(! valid_email($email)) + if(! valid_email($email)) $errs[] = t('Not valid email.'); $adm = trim(get_config('system','admin_email')); if(($adm) && (strcasecmp($email,$adm) == 0)) { @@ -376,10 +363,10 @@ class Settings extends \Zotlabs\Web\Controller { intval(local_channel()) ); - $global_perms = \Zotlabs\Access\Permissions::Perms(); + $global_perms = get_perms(); foreach($global_perms as $k => $v) { - \Zotlabs\Access\PermissionLimits::Set(local_channel(),$k,intval($_POST[$k])); + $set_perms .= ', ' . $v[0] . ' = ' . intval($_POST[$k]) . ' '; } $acl = new \Zotlabs\Access\AccessList($channel); $acl->set_from_array($_POST); @@ -394,8 +381,8 @@ class Settings extends \Zotlabs\Web\Controller { intval(local_channel()) ); } - else { - $role_permissions = \Zotlabs\Access\PermissionRoles::role_perms($_POST['permissions_role']); + else { + $role_permissions = get_role_perms($_POST['permissions_role']); if(! $role_permissions) { notice('Permissions category could not be found.'); return; @@ -435,25 +422,20 @@ class Settings extends \Zotlabs\Web\Controller { ); } - $x = \Zotlabs\Access\Permissions::FilledPerms($role_permissions['perms_connect']); - foreach($x as $k => $v) { - set_abconfig(local_channel(),$channel['channel_hash'],'my_perms',$k, $v); - if($role_permissions['perms_auto']) { - set_pconfig(local_channel(),'autoperms',$k,$v); - } - else { - del_pconfig(local_channel(),'autoperms',$k); + $r = q("update abook set abook_my_perms = %d where abook_channel = %d and abook_self = 1", + intval((array_key_exists('perms_accept',$role_permissions)) ? $role_permissions['perms_accept'] : 0), + intval(local_channel()) + ); + set_pconfig(local_channel(),'system','autoperms',(($role_permissions['perms_auto']) ? intval($role_permissions['perms_accept']) : 0)); + + foreach($role_permissions as $p => $v) { + if(strpos($p,'channel_') !== false) { + $set_perms .= ', ' . $p . ' = ' . intval($v) . ' '; } - } - - if($role_permissions['limits']) { - foreach($role_permissions['limits'] as $k => $v) { - \Zotlabs\Access\PermissionLimits::Set(local_channel(),$k,$v); + if($p === 'directory_publish') { + $publish = intval($v); } } - if(array_key_exists('directory_publish',$role_permissions)) { - $publish = intval($role_permissions['directory_publish']); - } } set_pconfig(local_channel(),'system','hide_online_status',$hide_presence); @@ -781,8 +763,6 @@ class Settings extends \Zotlabs\Web\Controller { if((argc() > 1) && (argv(1) === 'tokens')) { $atoken = null; - $atoken_xchan = ''; - if(argc() > 2) { $id = argv(2); @@ -791,56 +771,23 @@ class Settings extends \Zotlabs\Web\Controller { intval(local_channel()) ); - if($atoken) { + if($atoken) $atoken = $atoken[0]; - $atoken_xchan = substr($channel['channel_hash'],0,16) . '.' . $atoken['atoken_name']; - } if($atoken && argc() > 3 && argv(3) === 'drop') { - atoken_delete($id); - $atoken = null; - $atoken_xchan = ''; + $r = q("delete from atoken where atoken_id = %d", + intval($id) + ); } } - $t = q("select * from atoken where atoken_uid = %d", intval(local_channel()) ); - $desc = t('Use this form to create temporary access identifiers to share things with non-members. These identities may be used in Access Control Lists and visitors may login using these credentials to access private content.'); + $desc = t('Use this form to create temporary access identifiers to share things with non-members. These identities may be used in Access Control Lists and visitors may login using these credentials to access the private content.'); $desc2 = t('You may also provide <em>dropbox</em> style access links to friends and associates by adding the Login Password to any specific site URL as shown. Examples:'); - $global_perms = \Zotlabs\Access\Permissions::Perms(); - - $existing = get_all_perms(local_channel(),(($atoken_xchan) ? $atoken_xchan : '')); - - if($atoken_xchan) { - $theirs = q("select * from abconfig where chan = %d and xchan = '%s' and cat = 'their_perms'", - intval(local_channel()), - dbesc($atoken_xchan) - ); - $their_perms = array(); - if($theirs) { - foreach($theirs as $t) { - $their_perms[$t['k']] = $t['v']; - } - } - } - foreach($global_perms as $k => $v) { - $thisperm = get_abconfig(local_channel(),$contact['abook_xchan'],'my_perms',$k); -//fixme - - $checkinherited = \Zotlabs\Access\PermissionLimits::Get(local_channel(),$k); - - if($existing[$k]) - $thisperm = "1"; - - $perms[] = array('perms_' . $k, $v, ((array_key_exists($k,$their_perms)) ? intval($their_perms[$k]) : ''),$thisperm, 1, (($checkinherited & PERMS_SPECIFIC) ? '' : '1'), '', $checkinherited); - } - - - $tpl = get_markup_template("settings_tokens.tpl"); $o .= replace_macros($tpl, array( '$form_security_token' => get_form_security_token("settings_tokens"), @@ -854,13 +801,6 @@ class Settings extends \Zotlabs\Web\Controller { '$name' => array('name', t('Login Name') . ' <span class="required">*</span>', (($atoken) ? $atoken['atoken_name'] : ''),''), '$token'=> array('token', t('Login Password') . ' <span class="required">*</span>',(($atoken) ? $atoken['atoken_token'] : autoname(8)), ''), '$expires'=> array('expires', t('Expires (yyyy-mm-dd)'), (($atoken['atoken_expires'] && $atoken['atoken_expires'] != NULL_DATE) ? datetime_convert('UTC',date_default_timezone_get(),$atoken['atoken_expires']) : ''), ''), - '$them' => t('Their Settings'), - '$me' => t('My Settings'), - '$perms' => $perms, - '$inherited' => t('inherited'), - '$notself' => '1', - '$permlbl' => t('Individual Permissions'), - '$permnote' => t('Some permissions may be inherited from your channel\'s <a href="settings"><strong>privacy settings</strong></a>, which have higher priority than individual settings. You can <strong>not</strong> change those settings here.'), '$submit' => t('Submit') )); return $o; @@ -1023,7 +963,11 @@ class Settings extends \Zotlabs\Web\Controller { return $o; } - + + + + + if(argv(1) === 'channel') { require_once('include/acl_selectors.php'); @@ -1040,8 +984,9 @@ class Settings extends \Zotlabs\Web\Controller { $channel = \App::get_channel(); - $global_perms = \Zotlabs\Access\Permissions::Perms(); - + + $global_perms = get_perms(); + $permiss = array(); $perm_opts = array( @@ -1055,18 +1000,19 @@ class Settings extends \Zotlabs\Web\Controller { array( t('Anybody on the internet'), PERMS_PUBLIC) ); - $limits = \Zotlabs\Access\PermissionLimits::Get(local_channel()); foreach($global_perms as $k => $perm) { $options = array(); foreach($perm_opts as $opt) { + if((! $perm[2]) && $opt[1] == PERMS_PUBLIC) + continue; $options[$opt[1]] = $opt[0]; } - $permiss[] = array($k,$perm,$limits[$k],'',$options); + $permiss[] = array($k,$perm[3],$channel[$perm[0]],$perm[4],$options); } - //logger('permiss: ' . print_r($permiss,true)); + // logger('permiss: ' . print_r($permiss,true)); @@ -1220,10 +1166,6 @@ class Settings extends \Zotlabs\Web\Controller { '$permissions' => t('Default Post and Publish Permissions'), '$permdesc' => t("\x28click to open/close\x29"), '$aclselect' => populate_acl($perm_defaults, false, \Zotlabs\Lib\PermissionDescription::fromDescription(t('Use my default audience setting for the type of object published'))), - '$allow_cid' => acl2json($perm_defaults['allow_cid']), - '$allow_gid' => acl2json($perm_defaults['allow_gid']), - '$deny_cid' => acl2json($perm_defaults['deny_cid']), - '$deny_gid' => acl2json($perm_defaults['deny_gid']), '$suggestme' => $suggestme, '$group_select' => $group_select, '$role' => array('permissions_role' , t('Channel permissions category:'), $permissions_role, '', get_roles()), @@ -1286,7 +1228,7 @@ class Settings extends \Zotlabs\Web\Controller { call_hooks('settings_form',$o); - //$o .= '</form>' . "\r\n"; + $o .= '</form>' . "\r\n"; return $o; } diff --git a/Zotlabs/Module/Setup.php b/Zotlabs/Module/Setup.php index 4553b6866..802f0c216 100644 --- a/Zotlabs/Module/Setup.php +++ b/Zotlabs/Module/Setup.php @@ -101,7 +101,7 @@ class Setup extends \Zotlabs\Web\Controller { $timezone = notags(trim($_POST['timezone'])); $adminmail = notags(trim($_POST['adminmail'])); $siteurl = notags(trim($_POST['siteurl'])); - $advanced = ((intval($_POST['advanced'])) ? 'pro' : 'basic'); + $advanced = ((intval($_POST['advanced'])) ? 1 : 0); if($siteurl != z_root()) { $test = z_fetch_url($siteurl."/setup/testrewrite"); @@ -124,17 +124,17 @@ class Setup extends \Zotlabs\Web\Controller { $tpl = get_intltext_template('htconfig.tpl'); $txt = replace_macros($tpl,array( - '$dbhost' => $dbhost, - '$dbport' => $dbport, - '$dbuser' => $dbuser, - '$dbpass' => $dbpass, - '$dbdata' => $dbdata, - '$dbtype' => $dbtype, - '$server_role' => $advanced, - '$timezone' => $timezone, - '$siteurl' => $siteurl, - '$site_id' => random_string(), - '$phpath' => $phpath, + '$dbhost' => $dbhost, + '$dbport' => $dbport, + '$dbuser' => $dbuser, + '$dbpass' => $dbpass, + '$dbdata' => $dbdata, + '$dbtype' => $dbtype, + '$uno' => 1 - $advanced, + '$timezone' => $timezone, + '$siteurl' => $siteurl, + '$site_id' => random_string(), + '$phpath' => $phpath, '$adminmail' => $adminmail )); diff --git a/Zotlabs/Module/Thing.php b/Zotlabs/Module/Thing.php index a7ac63f73..65fc0588e 100644 --- a/Zotlabs/Module/Thing.php +++ b/Zotlabs/Module/Thing.php @@ -312,10 +312,6 @@ class Thing extends \Zotlabs\Web\Controller { '$imgurl' => $r[0]['obj_imgurl'], '$permissions' => t('Permissions'), '$aclselect' => populate_acl($channel_acl,false), - '$allow_cid' => acl2json($channel_acl['allow_cid']), - '$allow_gid' => acl2json($channel_acl['allow_gid']), - '$deny_cid' => acl2json($channel_acl['deny_cid']), - '$deny_gid' => acl2json($channel_acl['deny_gid']), '$lockstate' => $lockstate, '$submit' => t('Submit') )); @@ -362,10 +358,6 @@ class Thing extends \Zotlabs\Web\Controller { '$img_lbl' => t('URL for photo of thing (optional)'), '$permissions' => t('Permissions'), '$aclselect' => populate_acl($channel_acl,false), - '$allow_cid' => acl2json($channel_acl['allow_cid']), - '$allow_gid' => acl2json($channel_acl['allow_gid']), - '$deny_cid' => acl2json($channel_acl['deny_cid']), - '$deny_gid' => acl2json($channel_acl['deny_gid']), '$lockstate' => $lockstate, '$submit' => t('Submit') )); diff --git a/Zotlabs/Module/Webpages.php b/Zotlabs/Module/Webpages.php index 0a48d43c6..cc0a01cce 100644 --- a/Zotlabs/Module/Webpages.php +++ b/Zotlabs/Module/Webpages.php @@ -45,29 +45,7 @@ class Webpages extends \Zotlabs\Web\Controller { $observer = \App::get_observer(); $channel = \App::get_channel(); - - switch ($_SESSION['action']) { - case 'import': - $_SESSION['action'] = null; - $o .= replace_macros(get_markup_template('webpage_import.tpl'), array( - '$title' => t('Import Webpage Elements'), - '$importbtn' => t('Import selected'), - '$action' => 'import', - '$pages' => $_SESSION['pages'], - '$layouts' => $_SESSION['layouts'], - '$blocks' => $_SESSION['blocks'], - )); - return $o; - - case 'importselected': - $_SESSION['action'] = null; - break; - default : - $_SESSION['action'] = null; - break; - } - - + if(\App::$is_sys && is_site_admin()) { $sys = get_sys_channel(); if($sys && intval($sys['channel_id'])) { @@ -127,7 +105,6 @@ class Webpages extends \Zotlabs\Web\Controller { 'nickname' => \App::$profile['channel_address'], 'lockstate' => (($channel['channel_allow_cid'] || $channel['channel_allow_gid'] || $channel['channel_deny_cid'] || $channel['channel_deny_gid']) ? 'lock' : 'unlock'), 'acl' => (($is_owner) ? populate_acl($channel_acl,false, \Zotlabs\Lib\PermissionDescription::fromGlobalPermission('view_pages')) : ''), - 'permissions' => (($is_owner) ? $channel_acl : ''), 'showacl' => (($is_owner) ? true : false), 'visitor' => true, 'hide_location' => true, @@ -232,165 +209,4 @@ class Webpages extends \Zotlabs\Web\Controller { return $o; } - function post() { - - $action = $_REQUEST['action']; - if( $action ){ - switch ($action) { - case 'scan': - - // the state of this variable tracks whether website files have been scanned (null, true, false) - $cloud = null; - - // Website files are to be imported from an uploaded zip file - if(($_FILES) && array_key_exists('zip_file',$_FILES) && isset($_POST['w_upload'])) { - $source = $_FILES["zip_file"]["tmp_name"]; - $type = $_FILES["zip_file"]["type"]; - $okay = false; - $accepted_types = array('application/zip', 'application/x-zip-compressed', 'multipart/x-zip', 'application/x-compressed'); - foreach ($accepted_types as $mime_type) { - if ($mime_type == $type) { - $okay = true; - break; - } - } - if(!$okay) { - notice( t('Invalid file type.') . EOL); - return; - } - $zip = new \ZipArchive(); - if ($zip->open($source) === true) { - $tmp_folder_name = random_string(5); - $website = dirname($source) . '/' . $tmp_folder_name; - $zip->extractTo($website); // change this to the correct site path - $zip->close(); - @unlink($source); // delete the compressed file now that the content has been extracted - $cloud = false; - } else { - notice( t('Error opening zip file') . EOL); - return null; - } - } - - // Website files are to be imported from the channel cloud files - if (($_POST) && array_key_exists('path',$_POST) && isset($_POST['cloudsubmit'])) { - - $channel = \App::get_channel(); - $dirpath = get_dirpath_by_cloudpath($channel, $_POST['path']); - if(!$dirpath) { - notice( t('Invalid folder path.') . EOL); - return null; - } - $cloud = true; - - } - - // If the website files were uploaded or specified in the cloud files, then $cloud - // should be either true or false - if ($cloud !== null) { - require_once('include/import.php'); - $elements = []; - if($cloud) { - $path = $_POST['path']; - } else { - $path = $website; - } - $elements['pages'] = scan_webpage_elements($path, 'page', $cloud); - $elements['layouts'] = scan_webpage_elements($path, 'layout', $cloud); - $elements['blocks'] = scan_webpage_elements($path, 'block', $cloud); - $_SESSION['blocks'] = $elements['blocks']; - $_SESSION['layouts'] = $elements['layouts']; - $_SESSION['pages'] = $elements['pages']; - if(!(empty($elements['pages']) && empty($elements['blocks']) && empty($elements['layouts']))) { - //info( t('Webpages elements detected.') . EOL); - $_SESSION['action'] = 'import'; - } else { - notice( t('No webpage elements detected.') . EOL); - $_SESSION['action'] = null; - } - - } - - // If the website elements were imported from a zip file, delete the temporary decompressed files - if ($cloud === false && $website && $elements) { - rrmdir($website); // Delete the temporary decompressed files - } - - break; - - case 'importselected': - require_once('include/import.php'); - $channel = \App::get_channel(); - - // Import layout first so that pages that reference new layouts will find - // the mid of layout items in the database - - // Obtain the user-selected layouts to import and import them - $checkedlayouts = $_POST['layout']; - $layouts = []; - if (!empty($checkedlayouts)) { - foreach ($checkedlayouts as $name) { - foreach ($_SESSION['layouts'] as &$layout) { - if ($layout['name'] === $name) { - $layout['import'] = 1; - $layoutstoimport[] = $layout; - } - } - } - foreach ($layoutstoimport as $elementtoimport) { - $layouts[] = import_webpage_element($elementtoimport, $channel, 'layout'); - } - } - $_SESSION['import_layouts'] = $layouts; - - // Obtain the user-selected blocks to import and import them - $checkedblocks = $_POST['block']; - $blocks = []; - if (!empty($checkedblocks)) { - foreach ($checkedblocks as $name) { - foreach ($_SESSION['blocks'] as &$block) { - if ($block['name'] === $name) { - $block['import'] = 1; - $blockstoimport[] = $block; - } - } - } - foreach ($blockstoimport as $elementtoimport) { - $blocks[] = import_webpage_element($elementtoimport, $channel, 'block'); - } - } - $_SESSION['import_blocks'] = $blocks; - - // Obtain the user-selected pages to import and import them - $checkedpages = $_POST['page']; - $pages = []; - if (!empty($checkedpages)) { - foreach ($checkedpages as $pagelink) { - foreach ($_SESSION['pages'] as &$page) { - if ($page['pagelink'] === $pagelink) { - $page['import'] = 1; - $pagestoimport[] = $page; - } - } - } - foreach ($pagestoimport as $elementtoimport) { - $pages[] = import_webpage_element($elementtoimport, $channel, 'page'); - } - } - $_SESSION['import_pages'] = $pages; - if(!(empty($_SESSION['import_pages']) && empty($_SESSION['import_blocks']) && empty($_SESSION['import_layouts']))) { - info( t('Import complete.') . EOL); - } - break; - - default : - break; - } - } - - - - - } - } diff --git a/Zotlabs/Module/Wiki.php b/Zotlabs/Module/Wiki.php index bb4e9179c..55a52ea6d 100644 --- a/Zotlabs/Module/Wiki.php +++ b/Zotlabs/Module/Wiki.php @@ -74,16 +74,11 @@ class Wiki extends \Zotlabs\Web\Controller { // Initialize the ACL to the channel default permissions $x = array( 'lockstate' => (( $local_observer['channel_allow_cid'] || - $local_observer['channel_allow_gid'] || - $local_observer['channel_deny_cid'] || - $local_observer['channel_deny_gid']) - ? 'lock' : 'unlock' - ), + $local_observer['channel_allow_gid'] || + $local_observer['channel_deny_cid'] || + $local_observer['channel_deny_gid']) + ? 'lock' : 'unlock'), 'acl' => populate_acl($channel_acl), - 'allow_cid' => acl2json($channel_acl['allow_cid']), - 'allow_gid' => acl2json($channel_acl['allow_gid']), - 'deny_cid' => acl2json($channel_acl['deny_cid']), - 'deny_gid' => acl2json($channel_acl['deny_gid']), 'bang' => '' ); } else { @@ -147,8 +142,8 @@ class Wiki extends \Zotlabs\Web\Controller { } $content = ($p['content'] !== '' ? htmlspecialchars_decode($p['content'],ENT_COMPAT) : '"# New page\n"'); // Render the Markdown-formatted page content in HTML - require_once('library/markdown.php'); - $html = wiki_generate_toc(purify_html(Markdown(wiki_bbcode(json_decode($content))))); + require_once('library/markdown.php'); + $html = wiki_generate_toc(purify_html(Markdown(json_decode($content)))); $renderedContent = wiki_convert_links($html,argv(0).'/'.argv(1).'/'.$wikiUrlName); $hide_editor = false; $showPageControls = $wiki_editor; @@ -191,10 +186,6 @@ class Wiki extends \Zotlabs\Web\Controller { '$page' => $pageUrlName, '$lockstate' => $x['lockstate'], '$acl' => $x['acl'], - '$allow_cid' => $x['allow_cid'], - '$allow_gid' => $x['allow_gid'], - '$deny_cid' => $x['deny_cid'], - '$deny_gid' => $x['deny_gid'], '$bang' => $x['bang'], '$content' => $content, '$renderedContent' => $renderedContent, @@ -230,7 +221,6 @@ class Wiki extends \Zotlabs\Web\Controller { $content = $_POST['content']; $resource_id = $_POST['resource_id']; require_once('library/markdown.php'); - $content = wiki_bbcode($content); $html = wiki_generate_toc(purify_html(Markdown($content))); $w = wiki_get_wiki($resource_id); $wikiURL = argv(0).'/'.argv(1).'/'.$w['urlName']; |