Dotclear

Changeset 4001:a2dd2cb6fd33 for inc


Ignore:
Timestamp:
07/01/19 11:23:37 (6 years ago)
Author:
franck <carnet.franck.paul@…>
Branch:
default
Message:

Add settings (in maintenance plugin) for CSP system

Location:
inc/core
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • inc/core/class.dc.namespace.php

    r3874 r4001  
    349349 
    350350    /** 
     351     * Removes every existing specific setting in a namespace 
     352     * 
     353     * @param      string     $id      Setting ID 
     354     * @param      boolean    $global  Remove global setting too 
     355     */ 
     356    public function dropEvery($id, $global = false) 
     357    { 
     358        if (!$this->ns) { 
     359            throw new Exception(__('No namespace specified')); 
     360        } 
     361 
     362        $strReq = 'DELETE FROM ' . $this->table . ' '; 
     363        if (!$global) { 
     364            $strReq .= 'WHERE blog_id IS NOT NULL '; 
     365        } 
     366        $strReq .= "AND setting_id = '" . $this->con->escape($id) . "' "; 
     367        $strReq .= "AND setting_ns = '" . $this->con->escape($this->ns) . "' "; 
     368 
     369        $this->con->execute($strReq); 
     370    } 
     371 
     372    /** 
    351373    Removes all existing settings in a Namespace 
    352374 
  • inc/core/class.dc.workspace.php

    r3874 r4001  
    365365 
    366366    /** 
     367     * Removes every existing specific pref. in a workspace 
     368     * 
     369     * @param      string     $id      Pref ID 
     370     * @param      boolean    $global  Remove global pref too 
     371     */ 
     372    public function dropEvery($id, $global = false) 
     373    { 
     374        if (!$this->ws) { 
     375            throw new Exception(__('No workspace specified')); 
     376        } 
     377 
     378        $strReq = 'DELETE FROM ' . $this->table . ' '; 
     379        if (!$global) { 
     380            $strReq .= 'WHERE user_id IS NOT NULL '; 
     381        } 
     382        $strReq .= "AND pref_id = '" . $this->con->escape($id) . "' "; 
     383        $strReq .= "AND pref_ws = '" . $this->con->escape($this->ws) . "' "; 
     384 
     385        $this->con->execute($strReq); 
     386    } 
     387 
     388    /** 
    367389    Removes all existing pref. in a Workspace 
    368390 
Note: See TracChangeset for help on using the changeset viewer.

Sites map