Changeset 1142 in subversion
- Timestamp:
- Feb 26, 2008 1:08:19 PM (5 years ago)
- Location:
- trunk/roundcubemail/installer
- Files:
-
- 5 edited
-
config.php (modified) (3 diffs)
-
index.php (modified) (1 diff)
-
rcube_install.php (modified) (3 diffs)
-
styles.css (modified) (1 diff)
-
test.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/roundcubemail/installer/config.php
r1141 r1142 6 6 require_once 'include/rcube_html.inc'; 7 7 8 $RCI->load_config(); 8 9 $RCI->load_defaults(); 9 10 … … 168 169 <?php 169 170 171 require_once 'DB.php'; 172 170 173 $supported_dbs = array('MySQL' => 'mysql', 'MySQLi' => 'mysqli', 171 174 'PgSQL' => 'pgsql', 'SQLite' => 'sqlite'); … … 183 186 $input_dbpass = new textfield(array('name' => '_dbpass', 'size' => 20, 'id' => "cfgdbpass")); 184 187 185 $dsnw = parse_url($RCI->getprop('db_dsnw'));186 187 echo $select_dbtype->show($_POST['_dbtype'] ? $_POST['_dbtype'] : $dsnw[' scheme']);188 $dsnw = DB::parseDSN($RCI->getprop('db_dsnw')); 189 190 echo $select_dbtype->show($_POST['_dbtype'] ? $_POST['_dbtype'] : $dsnw['phptype']); 188 191 echo '<label for="cfgdbtype">Database type</label><br />'; 189 echo $input_dbhost->show($_POST['_dbhost'] ? $_POST['_dbhost'] : $dsnw['host ']);192 echo $input_dbhost->show($_POST['_dbhost'] ? $_POST['_dbhost'] : $dsnw['hostspec']); 190 193 echo '<label for="cfgdbhost">Database server</label><br />'; 191 echo $input_dbname->show($_POST['_dbname'] ? $_POST['_dbname'] : preg_replace('/^\//', '', $dsnw['path']));194 echo $input_dbname->show($_POST['_dbname'] ? $_POST['_dbname'] : $dsnw['database']); 192 195 echo '<label for="cfgdbname">Database name</label><br />'; 193 echo $input_dbuser->show($_POST['_dbuser'] ? $_POST['_dbuser'] : $dsnw['user ']);196 echo $input_dbuser->show($_POST['_dbuser'] ? $_POST['_dbuser'] : $dsnw['username']); 194 197 echo '<label for="cfgdbuser">Database user name (needs write permissions)</label><br />'; 195 echo $input_dbpass->show($_POST['_dbpass'] ? $_POST['_dbpass'] : $dsnw['pass ']);198 echo $input_dbpass->show($_POST['_dbpass'] ? $_POST['_dbpass'] : $dsnw['password']); 196 199 echo '<label for="cfgdbpass">Database password</label><br />'; 197 200 -
trunk/roundcubemail/installer/index.php
r1139 r1142 65 65 66 66 <div id="footer"> 67 Installer by the RoundCube Dev Team. Copyright © 2008 - Published under the GNU Public License 67 Installer by the RoundCube Dev Team. Copyright © 2008 - Published under the GNU Public License; 68 Icons by <a href="http://famfamfam.com">famfamfam</a> 68 69 </div> 69 70 </body> -
trunk/roundcubemail/installer/rcube_install.php
r1141 r1142 28 28 var $config = array(); 29 29 var $last_error = null; 30 var $email_pattern = '([a-z0-9][a-z0-9\-\.\+\_]*@[a-z0-9]([a-z0-9\-][.]?)*[a-z0-9])'; 30 31 31 32 /** … … 89 90 * 90 91 * @param string Property name 92 * @param string Default value 91 93 * @return string The property value 92 94 */ 93 function getprop($name )95 function getprop($name, $default = null) 94 96 { 95 97 $value = isset($_REQUEST["_$name"]) ? $_REQUEST["_$name"] : $this->config[$name]; … … 98 100 $value = self::random_key(24); 99 101 100 return $value ;102 return $value !== null ? $value : $default; 101 103 } 102 104 -
trunk/roundcubemail/installer/styles.css
r1141 r1142 138 138 } 139 139 140 label {140 dd label { 141 141 padding-left: 0.5em; 142 142 } -
trunk/roundcubemail/installer/test.php
r1141 r1142 124 124 ?> 125 125 126 <p>[@todo Add tests for IMAP and SMTP settings]</p> 126 <h3>Test SMTP settings</h3> 127 128 <p> 129 Server: <?php echo $RCI->getprop('smtp_server', 'PHP mail()'); ?><br /> 130 Port: <?php echo $RCI->getprop('smtp_port'); ?><br /> 131 User: <?php echo $RCI->getprop('smtp_user', '(none)'); ?><br /> 132 Password: <?php echo $RCI->getprop('smtp_pass', '(none)'); ?><br /> 133 </p> 134 135 <?php 136 137 if (isset($_POST['sendmail']) && !empty($_POST['_from']) && !empty($_POST['_to'])) { 138 139 require_once 'lib/rc_mail_mime.inc'; 140 require_once 'include/rcube_smtp.inc'; 141 142 echo '<p>Trying to send email...<br />'; 143 144 if (preg_match('/^' . $RCI->email_pattern . '$/i', trim($_POST['_from'])) && 145 preg_match('/^' . $RCI->email_pattern . '$/i', trim($_POST['_to']))) { 146 147 $recipients = trim($_POST['_to']); 148 149 $headers = array( 150 'From' => trim($_POST['_from']), 151 'To' => $recipients, 152 'Subject' => 'Test message from RoundCube', 153 ); 154 155 $body = 'This is a test to confirm that RoundCube can send email.'; 156 157 $mail_object = new rc_mail_mime(); 158 $send_headers = $mail_object->headers($headers); 159 160 $smtp_response = array(); 161 $status = smtp_mail($headers['From'], $recipients, 162 ($foo = $mail_object->txtHeaders($send_headers)), 163 $body, $smtp_response); 164 165 if ($status) { 166 $RCI->pass('SMTP send'); 167 } 168 else { 169 $RCI->fail('SMTP send', join('; ', $smtp_response)); 170 } 171 } 172 else { 173 $RCI->fail('SMTP send', 'Invalid sender or recipient'); 174 } 175 } 176 177 echo '</p>'; 178 179 ?> 180 181 <table> 182 <tbody> 183 <tr><td><label for="sendmailfrom">Sender</label></td><td><input type="text" name="_from" value="" id="sendmailfrom" /></td></tr> 184 <tr><td><label for="sendmailto">Recipient</label></td><td><input type="text" name="_to" value="" id="sendmailto" /></td></tr> 185 </tbody> 186 </table> 187 188 <p><input type="submit" name="sendmail" value="Send test mail" /></p> 189 190 191 <p>[@todo Add tests for IMAP settings]</p> 127 192 128 193 </form>
Note: See TracChangeset
for help on using the changeset viewer.
