function getID_table_action($table, $action) { $query = 'SELECT ActionID FROM Actions WHERE ' . MySQL_buildonemanykey('ActionGenericTable', $table) . ' AND ' . MySQL_buildonemanykey('ActionType', $action); global $MySQL_singleton_abort; $val = MySQL_singleton($query); return $val; }
function getGroupActionTable($GroupID, $table) { $query = 'SELECT ActionType,TRUE FROM Actions JOIN GroupActionMapping USING (ActionID) WHERE ' . $this->_Mapping->primaryWhere($GroupID) . ' AND ' . MySQL_buildonemanykey('ActionGenericTable', $table) . ';'; $overridePerm = 0; // 0 for normal op - FIXME TODO $query1 = 'SELECT DISTINCT ActionType,1 FROM Actions JOIN GroupActionMapping USING (ActionID) WHERE ' . $this->_Mapping->primaryWhere($GroupID) . ' AND ' . MySQL_buildonemanykey('ActionGenericTable', $table) . ';'; $query2 = 'SELECT DISTINCT ActionType,' . $overridePerm . ' FROM Actions'; $arr1 = MySQL_associativesingleton($query1); $arr2 = MySQL_associativesingleton($query2); $arr = array_merge($arr2, $arr1); return $arr; }
function secondaryWhere($SecondaryID) { return MySQL_buildonemanykey($this->_secondary, $SecondaryID); }
function getID_login_password($login, $password) { $query = 'SELECT UserID FROM Users WHERE ' . MySQL_buildonemanykey('UserLogin', $login) . ' AND ' . MySQL_buildonemanykey('UserPassword', $password); return MySQL_singleton($query); }