File indexing completed on 2024-11-24 05:19:14
0001 <?php 0002 class CommentsModel extends EModel { 0003 public function leaveComment ($id) { 0004 $type = "1"; 0005 $content = $id; 0006 $content2 = "1"; 0007 $parent = ""; 0008 $subject = EHeaderDataParser::secure_post("inputSubject"); 0009 $message = EHeaderDataParser::secure_post("inputMessage"); 0010 0011 $postdata = array( 0012 "type" => $type, 0013 "content" => $content, 0014 "content2" => $content2, 0015 "parent" => $parent, 0016 "subject" => $subject, 0017 "message" => $message, 0018 ); 0019 0020 $client = new OCSClient(EConfig::$data["ocs"]["host"]); 0021 $client->set_auth_info(EHeaderDataParser::get_cookie("login"),EHeaderDataParser::get_cookie("password")); 0022 $check = $client->post("v1/comments/add",$postdata); 0023 0024 if($check["ocs"]["meta"]["statuscode"]=="100"){ 0025 //cosa fare se va a buon fine 0026 header("Location: /plasmastore/app_description/show/$id"); 0027 } 0028 else {echo $check["ocs"]["meta"]["statuscode"];} 0029 } 0030 } 0031 0032 ?>