Changeset ae2fe66 in github


Ignore:
Timestamp:
Sep 21, 2008 7:58:40 AM (5 years ago)
Author:
thomascube <thomas@…>
Children:
8992cad
Parents:
9418af7
Message:

Save posted config in session for later download

Location:
installer
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • installer/config.php

    rbba657e rae2fe66  
    3131   
    3232  echo '<div><em>main.inc.php (<a href="index.php?_getfile=main">download</a>)</em></div>'; 
    33   echo $textbox->show($RCI->create_config('main')); 
     33  echo $textbox->show(($_SESSION['main.inc.php'] = $RCI->create_config('main'))); 
    3434   
    3535  echo '<div style="margin-top:1em"><em>db.inc.php (<a href="index.php?_getfile=db">download</a>)</em></div>'; 
    36   echo $textbox->show($RCI->create_config('db')); 
     36  echo $textbox->show($_SESSION['db.inc.php'] = $RCI->create_config('db')); 
    3737 
    3838  echo '<p class="hint">Of course there are more options to configure. 
  • installer/index.php

    rbba657e rae2fe66  
    3232$RCI->load_config(); 
    3333 
    34 if (isset($_GET['_getfile']) && in_array($_GET['_getfile'], array('main', 'db'))) 
    35 { 
    36   header('Content-type: text/plain'); 
    37   header('Content-Disposition: attachment; filename="'.$_GET['_getfile'].'.inc.php"'); 
    38   echo $RCI->create_config($_GET['_getfile']); 
    39   exit; 
     34if (isset($_GET['_getfile']) && in_array($_GET['_getfile'], array('main', 'db'))) { 
     35  $filename = $_GET['_getfile'] . '.inc.php'; 
     36  if (!empty($_SESSION[$filename])) { 
     37    header('Content-type: text/plain'); 
     38    header('Content-Disposition: attachment; filename="'.$filename.'"'); 
     39    echo $_SESSION[$filename]; 
     40    exit; 
     41  } 
     42  else { 
     43    header('HTTP/1.0 404 Not found'); 
     44    die("The requested configuration was not found. Please run the installer from the beginning."); 
     45  } 
    4046} 
    4147 
  • installer/rcube_install.php

    rbba657e rae2fe66  
    130130      if ($prop == 'debug_level') { 
    131131        $val = 0; 
    132         if (isset($value)) 
    133           foreach ($value as $dbgval) 
     132        if (is_array($value)) 
     133          foreach ($value as $dbgval) 
    134134            $val += intval($dbgval); 
    135         $value = $val; 
     135        $value = $val; 
    136136      } 
    137137      else if ($which == 'db' && $prop == 'db_dsnw' && !empty($_POST['_dbtype'])) { 
     
    140140        else 
    141141          $value = sprintf('%s://%s:%s@%s/%s', $_POST['_dbtype'],  
    142                     rawurlencode($_POST['_dbuser']), rawurlencode($_POST['_dbpass']), 
    143                     $_POST['_dbhost'], $_POST['_dbname']); 
     142            rawurlencode($_POST['_dbuser']), rawurlencode($_POST['_dbpass']), $_POST['_dbhost'], $_POST['_dbname']); 
    144143      } 
    145144      else if ($prop == 'smtp_auth_type' && $value == '0') { 
Note: See TracChangeset for help on using the changeset viewer.