Newer
Older
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
$rec = $app->remoting_lib->getDataRecord($primary_id);
$app->remoting_lib->datalogSave('DELETE',$primary_id,$rec,array());
}
return $affected_rows;
}
private function checkPerm($session_id, $function_name)
{
$dobre=Array();
$session = $this->getSession($session_id);
if(!$session){
return false;
}
$dobre= str_replace(';',',',$session['remote_functions']);
return in_array($function_name, explode(',', $dobre) );
}
private function getSession($session_id)
{
global $app;
if(empty($session_id)) {
$this->server->fault('session_id_empty','The SessionID is empty.');
return false;
}
$session_id = $app->db->quote($session_id);
$now = time();
$sql = "SELECT * FROM remote_session WHERE remote_session = '$session_id' AND tstamp >= $now";
$session = $app->db->queryOneRecord($sql);
if($session['remote_userid'] > 0) {
return $session;
} else {
$this->server->fault('session_does_not_exist','The Session is expired or does not exist.');
return false;
}
}
}
?>