Changeset 3998 in subversion
- Timestamp:
- Sep 29, 2010 4:30:56 AM (3 years ago)
- Location:
- trunk/roundcubemail
- Files:
-
- 1 added
- 3 edited
-
CHANGELOG (modified) (1 diff)
-
bin/msgexport.sh (modified) (3 diffs)
-
bin/msgimport.sh (modified) (2 diffs)
-
program/include/clisetup.php (added)
Legend:
- Unmodified
- Added
- Removed
-
trunk/roundcubemail/CHANGELOG
r3994 r3998 2 2 =========================== 3 3 4 - Fix msgexport.sh now using the new imap wrapper 5 - Avoid displaying password on shell (#1486947) 4 6 - Only lower-case user name if first login attempt failed (#1486393) 5 7 - Make alias setting in squirrelmail_usercopy plugin configurable (patch by pommi, #1487007) -
trunk/roundcubemail/bin/msgexport.sh
r3367 r3998 1 1 #!/usr/bin/env php 2 2 <?php 3 if (php_sapi_name() != 'cli') {4 die('Not on the "shell" (php-cli).');5 }6 3 7 4 define('INSTALL_PATH', realpath(dirname(__FILE__) . '/..') . '/' ); 8 5 ini_set('memory_limit', -1); 9 6 10 require_once INSTALL_PATH.'program/include/iniset.php'; 11 12 /** 13 * Parse commandline arguments into a hash array 14 */ 15 function get_opt($aliases=array()) 16 { 17 $args = array(); 18 for ($i=1; $i<count($_SERVER['argv']); $i++) 19 { 20 $arg = $_SERVER['argv'][$i]; 21 if (substr($arg, 0, 2) == '--') 22 { 23 $sp = strpos($arg, '='); 24 $key = substr($arg, 2, $sp - 2); 25 $value = substr($arg, $sp+1); 26 } 27 else if ($arg{0} == '-') 28 { 29 $key = substr($arg, 1); 30 $value = $_SERVER['argv'][++$i]; 31 } 32 else 33 continue; 34 35 $args[$key] = preg_replace(array('/^["\']/', '/["\']$/'), '', $value); 36 37 if ($alias = $aliases[$key]) 38 $args[$alias] = $args[$key]; 39 } 40 41 return $args; 42 } 7 require_once INSTALL_PATH.'program/include/clisetup.php'; 43 8 44 9 function print_usage() … … 90 55 91 56 fwrite($out, sprintf("From %s %s UID %d\n", $from['mailto'], $headers->date, $headers->uid)); 92 fwrite($out, iil_C_FetchPartHeader($IMAP->conn, $mbox, $i, null));93 fwrite($out, iil_C_HandlePartBody($IMAP->conn, $mbox, $i, null, 1));57 fwrite($out, $IMAP->conn->fetchPartHeader($mbox, $i)); 58 fwrite($out, $IMAP->conn->handlePartBody($mbox, $i)); 94 59 fwrite($out, "\n\n\n"); 95 60 … … 126 91 127 92 // prompt for password 128 vputs("Password: "); 129 $args['pass'] = trim(fgets(STDIN)); 93 $args['pass'] = prompt_silent("Password: "); 130 94 131 95 -
trunk/roundcubemail/bin/msgimport.sh
r2229 r3998 1 1 #!/usr/bin/env php 2 2 <?php 3 if (php_sapi_name() != 'cli') {4 die('Not on the "shell" (php-cli).');5 }6 3 7 4 define('INSTALL_PATH', realpath(dirname(__FILE__) . '/..') . '/' ); 8 5 ini_set('memory_limit', -1); 9 6 10 require_once INSTALL_PATH.'program/include/iniset.php'; 11 12 /** 13 * Parse commandline arguments into a hash array 14 */ 15 function get_opt($aliases=array()) 16 { 17 $args = array(); 18 for ($i=1; $i<count($_SERVER['argv']); $i++) 19 { 20 $arg = $_SERVER['argv'][$i]; 21 if (substr($arg, 0, 2) == '--') 22 { 23 $sp = strpos($arg, '='); 24 $key = substr($arg, 2, $sp - 2); 25 $value = substr($arg, $sp+1); 26 } 27 else if ($arg{0} == '-') 28 { 29 $key = substr($arg, 1); 30 $value = $_SERVER['argv'][++$i]; 31 } 32 else 33 continue; 34 35 $args[$key] = preg_replace(array('/^["\']/', '/["\']$/'), '', $value); 36 37 if ($alias = $aliases[$key]) 38 $args[$alias] = $args[$key]; 39 } 40 41 return $args; 42 } 7 require_once INSTALL_PATH.'program/include/clisetup.php'; 43 8 44 9 function print_usage() … … 83 48 if (empty($args['pass'])) 84 49 { 85 echo "Password: "; 86 $args['pass'] = trim(fgets(STDIN)); 87 88 // clear password input 89 echo chr(8)."\rPassword: ".str_repeat("*", strlen($args['pass']))."\n"; 50 $args['pass'] = prompt_silent("Password: "); 90 51 } 91 52
Note: See TracChangeset
for help on using the changeset viewer.
