''); }; // fcm_user_is_superuser // Check if the user is the superuser. function fcm_user_is_superuser ($cm_username) { global $cm_superuser; return ($cm_username == $cm_superuser); }; // fcm_user_is_ingroup2 // Check if user is in the group of given a page. function fcm_user_is_ingroup2 ($cm_username, $cm_path) { global $groups; if ($groups) { $result3 = db_query("select cmdb_directory, cmdb_viewer_group, cmdb_type from " . CM_DB_PREFIX . "content3 where cmdb_directory like '$cm_path' and cmdb_type like '%" . CM_HITTYPE_PAGE . "%'") or db_die(); $row3 = db_fetch_row($result3); $result2 = db_query("select ID, kurz from " . CM_PP_PREFIX . "users where kurz = '$cm_username'") or db_die(); $row2 = db_fetch_row($result2); $result1 = db_query("select user_ID, " . CM_PP_PREFIX . "gruppen.kurz from " . CM_PP_PREFIX . "grup_user, " . CM_PP_PREFIX . "gruppen where " . CM_PP_PREFIX . "grup_user.user_ID = '$row2[0]' and " . CM_PP_PREFIX . "grup_user.grup_ID = " . CM_PP_PREFIX . "gruppen.ID and " . CM_PP_PREFIX . "gruppen.kurz = '$row3[1]'") or db_die(); $row1 = db_fetch_row($result1); return ($row1[0] <> ''); } else { return (true); } }; // fcm_user_is_owner // Check if the user is the owner of the page. function fcm_user_is_owner ($cm_username, $cm_path) { $result2 = db_query("select cmdb_directory, cmdb_owner_user, cmdb_type from " . CM_DB_PREFIX . "content3 where cmdb_directory like '$cm_path' and cmdb_owner_user = '$cm_username' and cmdb_type like '%" . CM_HITTYPE_PAGE . "%'") or db_die(); $row2 = db_fetch_row($result2); return ($row2[0] <> ''); }; ?>