make lockview work with throwaway identities
This commit is contained in:
		| @@ -1,17 +1,31 @@ | |||||||
| <?php | <?php | ||||||
| namespace Zotlabs\Module; | namespace Zotlabs\Module; | ||||||
|  |  | ||||||
|  | require_once('include/security.php'); | ||||||
|  |  | ||||||
| class Lockview extends \Zotlabs\Web\Controller { | class Lockview extends \Zotlabs\Web\Controller { | ||||||
|  |  | ||||||
| 	function get() { | 	function get() { | ||||||
|  |  | ||||||
|  | 		$atokens = array(); | ||||||
|  |  | ||||||
|  | 		if(local_channel()) { | ||||||
|  | 			$at = q("select * from atoken where atoken_uid = %d", | ||||||
|  | 				intval(local_channel()) | ||||||
|  | 			); | ||||||
|  | 			if($at) { | ||||||
|  | 				foreach($at as $t) { | ||||||
|  | 					$atokens[] = atoken_xchan($t); | ||||||
|  | 				} | ||||||
|  | 			} | ||||||
|  | 		} | ||||||
|  | 	   | ||||||
| 		$type = ((argc() > 1) ? argv(1) : 0); | 		$type = ((argc() > 1) ? argv(1) : 0); | ||||||
| 		if (is_numeric($type)) { | 		if (is_numeric($type)) { | ||||||
| 			$item_id = intval($type); | 			$item_id = intval($type); | ||||||
| 			$type='item'; | 			$type='item'; | ||||||
| 		} else { | 		}  | ||||||
|  | 		else { | ||||||
| 			$item_id = ((argc() > 2) ? intval(argv(2)) : 0); | 			$item_id = ((argc() > 2) ? intval(argv(2)) : 0); | ||||||
| 		} | 		} | ||||||
| 	   | 	   | ||||||
| @@ -98,6 +112,13 @@ class Lockview extends \Zotlabs\Web\Controller { | |||||||
| 			if($r) | 			if($r) | ||||||
| 				foreach($r as $rr)  | 				foreach($r as $rr)  | ||||||
| 					$l[] = '<li>' . $rr['xchan_name'] . '</li>'; | 					$l[] = '<li>' . $rr['xchan_name'] . '</li>'; | ||||||
|  | 			if($atokens) { | ||||||
|  | 				foreach($atokens as $at) { | ||||||
|  | 					if(in_array("'" . $at['xchan_hash'] . "'",$allowed_users)) {	 | ||||||
|  | 						$l[] = '<li>' . $at['xchan_name'] . '</li>'; | ||||||
|  | 					} | ||||||
|  | 				} | ||||||
|  | 			} | ||||||
| 		} | 		} | ||||||
| 		if(count($deny_groups)) { | 		if(count($deny_groups)) { | ||||||
| 			$r = q("SELECT gname FROM `groups` WHERE hash IN ( " . implode(', ', $deny_groups) . " )"); | 			$r = q("SELECT gname FROM `groups` WHERE hash IN ( " . implode(', ', $deny_groups) . " )"); | ||||||
| @@ -110,6 +131,16 @@ class Lockview extends \Zotlabs\Web\Controller { | |||||||
| 			if($r) | 			if($r) | ||||||
| 				foreach($r as $rr)  | 				foreach($r as $rr)  | ||||||
| 					$l[] = '<li><strike>' . $rr['xchan_name'] . '</strike></li>'; | 					$l[] = '<li><strike>' . $rr['xchan_name'] . '</strike></li>'; | ||||||
|  |  | ||||||
|  | 			if($atokens) { | ||||||
|  | 				foreach($atokens as $at) { | ||||||
|  | 					if(in_array("'" . $at['xchan_hash'] . "'",$deny_users)) {	 | ||||||
|  | 						$l[] = '<li><strike>' . $at['xchan_name'] . '</strike></li>'; | ||||||
|  | 					} | ||||||
|  | 				} | ||||||
|  | 			} | ||||||
|  |  | ||||||
|  |  | ||||||
| 		} | 		} | ||||||
| 	 | 	 | ||||||
| 		echo $o . implode($l); | 		echo $o . implode($l); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user