Changeset 6806 for extensions/user_tags/include/t4u_content.class.php
- Timestamp:
- Aug 26, 2010, 7:57:55 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/user_tags/include/t4u_content.class.php
r6798 r6806 25 25 $this->plugin_config = $config; 26 26 27 if (preg_match('!/t4u_addtags.*!', $_SERVER['QUERY_STRING']) && !empty($_POST['tags'])) { 27 if (preg_match('!/t4u_addtags.*!', $_SERVER['QUERY_STRING']) 28 && !empty($_POST['tags']) 29 && hasPermission('add')) { 28 30 include_once(PHPWG_ROOT_PATH.'admin/include/functions.php'); 29 31 30 /* TODO: add permissions */31 32 $tag_ids = get_fckb_tag_ids($_POST['tags']); 32 33 set_tags($tag_ids, $_POST['image_id']); … … 34 35 } 35 36 36 if (preg_match('!/t4u_gettags.*!', $_SERVER['QUERY_STRING'])) { 37 if (preg_match('!/t4u_gettags.*!', $_SERVER['QUERY_STRING']) 38 && hasPermission('add')) { 37 39 include_once(PHPWG_ROOT_PATH.'admin/include/functions.php'); 38 40 39 /* TODO: add permissions */40 41 $query = ' 41 42 SELECT … … 52 53 global $template; 53 54 54 /* TODO: add permissions */ 55 if (!is_autorize_status(ACCESS_CLASSIC)) { return;} 55 if (!$this->hasPermission('add')) { 56 return false; 57 } 56 58 57 59 $template->func_known_script(array('id' => 'jquery', 58 'src' => get_root_url(). T4U_JS. '/jquery-1.4.2.js'60 'src' => get_root_url().'themes/default/js/jquery.packed.js' 59 61 ), 60 62 $template->smarty … … 68 70 $template->assign('T4U_IMAGE_ID', $picture['id']); 69 71 $template->assign('T4U_REFERER', htmlentities($picture['url'])); 72 $template->assign('T4U_PERMISSION_DELETE', $this->hasPermission('delete')); 73 70 74 $related_tags = array(); 71 75 if (!empty($template->smarty->_tpl_vars['related_tags'])) { … … 103 107 return $url; 104 108 } 109 110 private function hasPermission($permission='add') { 111 return 112 (($this->plugin_config->getPermission($permission)!='') 113 and is_autorize_status(get_access_type_status($this->plugin_config->getPermission($permission)))); 114 } 105 115 } 106 116 ?>
Note: See TracChangeset
for help on using the changeset viewer.