コード例 #1
0
ファイル: AgentManager.php プロジェクト: Symbiota/Symbiota
 public function getAndChangeAgentLinksFromRequest($agentlinksid = '')
 {
     $result = new agentlinks();
     $agentlinksid = preg_replace("[^0-9]", '', $agentlinksid);
     if (strlen($agentlinksid) > 0) {
         $result->load($agentlinksid);
     }
     $result->setagentid($_REQUEST["agentid"]);
     $result->settype($_REQUEST["type"]);
     $result->setlink($_REQUEST["link"]);
     $result->setisprimarytopicof($_REQUEST["isprimarytopicof"]);
     $result->settext($_REQUEST["text"]);
     return $result;
 }
コード例 #2
0
ファイル: handler.php プロジェクト: Symbiota/Symbiota
function createAgentLinks()
{
    $result = "";
    $am = new AgentManager();
    if ($am->isAgentEditor()) {
        $toSave = new agentlinks();
        if ($toSave != null) {
            $agentid = preg_replace('[^0-9]', '', array_key_exists("agentid", $_REQUEST) ? $_REQUEST["agentid"] : "");
            $toSave->setagentid($agentid);
            $result = editAgentLinks($toSave);
        } else {
            $result = "Error in creating agent links record.";
        }
    } else {
        $result = "You aren't authorized to edit agent records.";
    }
    return $result;
}