Changeset 1098 for trunk/common


Ignore:
Timestamp:
12/27/09 02:42:00 (2 years ago)
Author:
bogdan2412
Message:

Admin edit button on round textblocks.

Done by Toni.
Review URL: http://reviewboard.infoarena.ro/r/130/

Location:
trunk/common
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/common/security.php

    r1097 r1098  
    222222 
    223223    // Forward security to round. 
    224     if (preg_match("/^ \s* round: \s* (".IA_RE_ROUND_ID.") \s* $/xi", $textsec, $matches)) { 
     224    if (($round_id = textblock_security_is_round($textsec))) { 
    225225        require_once(IA_ROOT_DIR . "common/db/round.php"); 
    226         $round = round_get($matches[1]); 
     226        $round = round_get($round_id); 
    227227        if ($round === null) { 
    228228            log_warn("Bad security descriptor, ask an admin."); 
  • trunk/common/textblock.php

    r1097 r1098  
    188188} 
    189189 
    190 // Checks if the textblock is task and return the task_id if true or false if false 
     190// Checks if the textblock is task and returns the task_id if true or false if false 
    191191function textblock_security_is_task($textblock) { 
    192192    if (preg_match("/^ \s* task: \s* (".IA_RE_TASK_ID.") \s* $/xi", $textblock, $matches)) { 
     
    196196} 
    197197 
     198// Checks if the textblock is round and returns the round_id if true or false if false 
     199function textblock_security_is_round($textblock) { 
     200    if (preg_match("/^ \s* round: \s* (".IA_RE_ROUND_ID.") \s* $/xi", $textblock, $matches)) { 
     201        return $matches[1]; 
     202    } 
     203    return false; 
     204} 
     205 
     206 
    198207?> 
Note: See TracChangeset for help on using the changeset viewer.