Ignore:
Timestamp:
07/29/10 17:48:33 (19 months ago)
Author:
root
Message:

added support for Trac 0.12 Multirepos

File:
1 edited

Legend:

Unmodified
Added
Removed
  • modules/ExiteCMS/tracsvn/php-files/modules/tracsvn/admin.php

    r2093 r2365  
    3636    $database = stripinput($_POST['database']); 
    3737    $url = stripinput($_POST['url']); 
     38    $repo = stripinput($_POST['repo']); 
    3839    $trac_url = stripinput($_POST['trac_url']); 
    3940    $cmd = stripinput($_POST['cmd']); 
     
    4445    $view_diff = isNum($_POST['view_diff']) ? $_POST['view_diff'] : 102; 
    4546    $view_file = isNum($_POST['view_file']) ? $_POST['view_file'] : 102; 
    46      
     47 
    4748    $variables['message'] = ""; 
    4849 
     
    5152        $variables['message'] = ($variables['message'] == "" ? "" : "<br />") . $locale['406']; 
    5253    } else { 
     54        // if a repo is defined, check if it exists 
     55        if (!empty($repo)) { 
     56            if(!dbtable_exists("repository", $database)) { 
     57                $variables['message'] = ($variables['message'] == "" ? "" : "<br />") . $locale['459']; 
     58            } else { 
     59                $result = dbquery("SELECT * FROM ".$database.".repository WHERE name = '".mysql_real_escape_string($repo)."'"); 
     60                if (!dbrows($result)) { 
     61                    $variables['message'] = ($variables['message'] == "" ? "" : "<br />") . $locale['460']; 
     62                } 
     63            } 
     64        } 
    5365        // check if the cmd points to svn 
    5466        $_tmp = explode(" ", $cmd); 
     
    8698        $result = dbquery("UPDATE ".$db_prefix."configuration SET cfg_value = '".$database."' WHERE cfg_name = 'tracsvn_database'"); 
    8799        $result = dbquery("UPDATE ".$db_prefix."configuration SET cfg_value = '".$url."' WHERE cfg_name = 'tracsvn_url'"); 
     100        $result = dbquery("UPDATE ".$db_prefix."configuration SET cfg_value = '".$repo."' WHERE cfg_name = 'tracsvn_repo'"); 
    88101        $result = dbquery("UPDATE ".$db_prefix."configuration SET cfg_value = '".$trac_url."' WHERE cfg_name = 'tracsvn_trac_url'"); 
    89102        $result = dbquery("UPDATE ".$db_prefix."configuration SET cfg_value = '".$cmd."' WHERE cfg_name = 'tracsvn_svncmd'"); 
     
    121134    $database = $settings['tracsvn_database']; 
    122135    $url = $settings['tracsvn_url']; 
     136    $repo = $settings['tracsvn_repo']; 
    123137    $trac_url = $settings['tracsvn_trac_url']; 
    124138    $cmd = $settings['tracsvn_svncmd']; 
     
    190204$variables['database'] = $database; 
    191205$variables['url'] = $url; 
     206$variables['repo'] = $repo; 
    192207$variables['trac_url'] = $trac_url; 
    193208$variables['cmd'] = $cmd; 
Note: See TracChangeset for help on using the changeset viewer.