Changeset 1236

Show
Ignore:
Timestamp:
09/18/2008 01:01:22 AM (2 years ago)
Author:
DotMG
Message:

refs #811

Applied code in #811#comment:6

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/1.1.6.6/libs/Wakka.class.php

    r1229 r1236  
    16701670        } 
    16711671        function SaveACL($tag, $privilege, $list) { 
     1672                // the $default will be put in the SET statement of the INSERT SQL for default values. It isn't used in UPDATE. 
     1673                $default = "read_acl = '', write_acl = '', comment_acl = '', "; 
     1674                // we strip the privilege_acl from default, to avoid redundancy 
     1675                $default = str_replace($privilege."_acl = '',", '', $default); 
    16721676                if ($this->LoadACL($tag, $privilege, 0)) $this->Query("UPDATE ".$this->config["table_prefix"]."acls SET ".mysql_real_escape_string($privilege)."_acl = '".mysql_real_escape_string(trim(str_replace("\r", "", $list)))."' WHERE page_tag = '".mysql_real_escape_string($tag)."' LIMIT 1"); 
    1673                 else $this->Query("INSERT INTO ".$this->config["table_prefix"]."acls SET page_tag = '".mysql_real_escape_string($tag)."', ".mysql_real_escape_string($privilege)."_acl = '".mysql_real_escape_string(trim(str_replace("\r", "", $list)))."'"); 
     1677                else $this->Query("INSERT INTO ".$this->config["table_prefix"]."acls SET $default page_tag = '".mysql_real_escape_string($tag)."', ".mysql_real_escape_string($privilege)."_acl = '".mysql_real_escape_string(trim(str_replace("\r", "", $list)))."'"); 
    16741678        } 
    16751679        function TrimACLs($list) {