コード例 #1
0
 static function saveMessage($text, $securitygroup_id)
 {
     //if no security group id then must be admin. Otherwise, make sure the user is a member of the group
     global $current_user;
     if (empty($securitygroup_id) && !is_admin($current_user)) {
         return;
     }
     $message = new SecurityGroupMessage();
     if (empty($text)) {
         return;
     }
     // || !$feed->ACLAccess('save', true) )return;
     $text = strip_tags($text);
     $message->name = '';
     $message->description = $text;
     $message->securitygroup_id = $securitygroup_id;
     $message->save();
 }
コード例 #2
0
 function saveMessage()
 {
     //admins should be able to set a global message to All otherwise any other message must be attached to a group
     if (!empty($_REQUEST['description'])) {
         $text = htmlspecialchars($_REQUEST['description']);
         $securitygroup_id = htmlspecialchars($_REQUEST['securitygroup_id']);
         //allow for bold and italic user tags
         //$text = preg_replace('/&amp;lt;(\/*[bi])&amp;gt;/i','<$1>', $text);
         SecurityGroupMessage::saveMessage($text, $securitygroup_id);
     }
 }