still a bit of wiki permission weirdness, this should catch the major ones
This commit is contained in:
		| @@ -192,8 +192,9 @@ function wiki_exists_by_name($uid, $urlName) { | ||||
| function wiki_get_permissions($resource_id, $owner_id, $observer_hash) { | ||||
| 	// TODO: For now, only the owner can edit | ||||
| 	$sql_extra = item_permissions_sql($owner_id, $observer_hash); | ||||
| 	$r = q("SELECT * FROM item WHERE resource_type = '%s' AND resource_id = '%s' $sql_extra LIMIT 1", | ||||
| 				dbesc(WIKI_ITEM_RESOURCE_TYPE),  | ||||
| 	$r = q("SELECT * FROM item WHERE uid = %d and resource_type = '%s' AND resource_id = '%s' $sql_extra LIMIT 1", | ||||
| 		intval($owner_id), | ||||
| 		dbesc(WIKI_ITEM_RESOURCE_TYPE),  | ||||
|         dbesc($resource_id) | ||||
|     ); | ||||
| 	 | ||||
|   | ||||
| @@ -544,10 +544,5 @@ | ||||
| 				{{else}} | ||||
| 						$('#new-wiki-button').hide(); | ||||
| 				{{/if}} | ||||
| 				{{if $showPageControls}} | ||||
| 						$('#edit-wiki-button').show(); | ||||
| 				{{else}} | ||||
| 						$('#edit-wiki-button').hide(); | ||||
| 				{{/if}} | ||||
| 		}); | ||||
| </script> | ||||
| @@ -3,7 +3,7 @@ | ||||
| 		<ul class="nav nav-pills nav-stacked"> | ||||
| 		{{if $wikis}}		 | ||||
| 		{{foreach $wikis as $wiki}} | ||||
|         <li>{{if $owner}}<a href="#" onclick="wiki_show_edit_wiki_form('{{$wiki.title}}', '{{$wiki.resource_id}}'); return false;" class="pull-right wikilist" title="{{$edit}}"><i id="edit-wiki-button" class="fa fa-pencil"></i></a>{{/if}} | ||||
|         <li>{{if $owner}}<a href="#" onclick="wiki_show_edit_wiki_form('{{$wiki.title}}', '{{$wiki.resource_id}}'); return false;" class="pull-right wikilist" title="{{$edit}}"><i class="fa fa-pencil"></i></a>{{/if}} | ||||
| 			<a href="#" onclick="wiki_download_wiki('{{$wiki.resource_id}}'); return false;" title="{{$download}}" class="pull-right wikilist"><i class="fa fa-download"></i></a> | ||||
| 			<a href="/wiki/{{$channel}}/{{$wiki.urlName}}/Home" title="{{$view}}">{{$wiki.title}}</a> | ||||
|         </li>  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user