Hi everyone. What is the function of getAuthSQL(r) or getAuthSQL(u)? I sometimes see it in during SELECT query. I believe it's a function?? What file in the ISPC directory can I open to see what it does? Thanks in advance.
This function creates a sql snippet to validate the access rights of the queried database records. Take a look at the database library to see the code of this function.
Yes, thank you. I found it but still, what is the purpose of (r), (u), (a) and ('r', 'b')? What are the code referring too? My guess is (r) is referring to 'Read' but what are others for? I appreciate your reply. Thank you. PHP: function getAuthSQL($perm, $table = '') { global $app; $perm = $app->db->quote($perm); $table = $app->db->quote($table); if($_SESSION["s"]["user"]["typ"] == 'admin' || $_SESSION['s']['user']['mailuser_id'] > 0) { return '1'; } else { if ($table != ''){ $table = ' ' . $table . '.'; } $groups = ( $_SESSION["s"]["user"]["groups"] ) ? $_SESSION["s"]["user"]["groups"] : 0; $sql = '('; $sql .= "(" . $table . "sys_userid = ".$_SESSION["s"]["user"]["userid"]." AND " . $table . "sys_perm_user like '%$perm%') OR "; $sql .= "(" . $table . "sys_groupid IN (".$groups.") AND " . $table ."sys_perm_group like '%$perm%') OR "; $sql .= $table . "sys_perm_other like '%$perm%'"; $sql .= ')'; return $sql; } }