public static function cancel_friendship($touser) { $idfrom = OCSUser::id(); $info = OCSUser::server_get_user_info($touser); $id = $info[0]["id"]; //creating new table object $ocs_friendinvitation = new EModel("ocs_friendship"); EDatabase::q("DELETE FROM ocs_friendship WHERE (id1={$idfrom} AND id2={$id}) OR (id2={$idfrom} AND id1={$id}) LIMIT 2"); }
public function personget($format, $username = "") { if (empty($username)) { $user = $this->_checkpassword(); $username = $user; $DBuser = OCSUser::server_get_user_info($username); if ($DBuser == false) { $txt = OCSXML::generatexml(EConfig::$data["ocsserver"]["format"], 'failed', 101, 'person not found'); echo $txt; } else { if (isset($DBuser[0]) and is_array($DBuser[0])) { $DBuser = $DBuser[0]; } $xml = array(); $xml[0]['personid'] = $DBuser['login']; $xml[0]['firstname'] = $DBuser['firstname']; $xml[0]['lastname'] = $DBuser['lastname']; $xml[0]['email'] = $DBuser['email']; //ELog::pd($xml); //$xml[0]['description']=H01_UTIL::bbcode2html($DBuser['description']); $txt = OCSXML::generatexml(EConfig::$data["ocsserver"]["format"], 'ok', 100, '', $xml, 'person', 'full', 2); //$txt=OCSXML::generatexml($format,'failed',102,'data is private'); echo $txt; } } else { $this->personsearch($format, $username, '', '', '', '', '', '', '', '', '', '', '', '', ''); } }