[Asterisk-cvs] asterisk/contrib/scripts vmail.cgi,1.13,1.14
markster at lists.digium.com
markster at lists.digium.com
Sun Oct 31 21:06:15 CST 2004
Update of /usr/cvsroot/asterisk/contrib/scripts
In directory mongoose.digium.com:/tmp/cvs-serv17653/contrib/scripts
Modified Files:
vmail.cgi
Log Message:
vmail.cgi updates (bug #2686)
Index: vmail.cgi
===================================================================
RCS file: /usr/cvsroot/asterisk/contrib/scripts/vmail.cgi,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- vmail.cgi 15 Sep 2004 05:11:41 -0000 1.13
+++ vmail.cgi 1 Nov 2004 02:08:55 -0000 1.14
@@ -120,7 +120,7 @@
# db variables are present. Use db for authentication.
my $dbh = DBI->connect("DBI:mysql:$dbname:$dbhost",$dbuser,$dbpass);
- my $sth = $dbh->prepare(qq{select fullname,context from users where mailbox='$mbox' and password='$pass' and context='$context'});
+ my $sth = $dbh->prepare(qq{select fullname,context from voicemail where mailbox='$mbox' and password='$pass' and context='$context'});
$sth->execute();
if (($fullname, $category) = $sth->fetchrow_array()) {;
return ($fullname ? $fullname : "Extension $mbox in $context",$category);
@@ -184,7 +184,7 @@
# db variables are present. Use db for authentication.
my $dbh = DBI->connect("DBI:mysql:$dbname:$dbhost",$dbuser,$dbpass);
- my $sth = $dbh->prepare(qq{select fullname,context from users where mailbox='$mbox' and password='$pass' and context='$context'});
+ my $sth = $dbh->prepare(qq{select fullname,context from voicemail where mailbox='$mbox' and password='$pass' and context='$context'});
$sth->execute();
if (($fullname, $category) = $sth->fetchrow_array()) {;
return ($fullname ? $fullname : "unknown", $category);
@@ -242,7 +242,7 @@
# db variables are present. Use db for authentication.
my $dbh = DBI->connect("DBI:mysql:$dbname:$dbhost",$dbuser,$dbpass);
- my $sth = $dbh->prepare(qq{select mailbox,fullname,context from users where context='$context' order by mailbox});
+ my $sth = $dbh->prepare(qq{select mailbox,fullname,context from voicemail where context='$context' order by mailbox});
$sth->execute();
while (($mailbox, $fullname, $category) = $sth->fetchrow_array()) {
$text = $mailbox;
@@ -719,6 +719,8 @@
}
my $path = "/var/spool/asterisk/voicemail/$context/$mbox/$newfolder";
+ $path =~ /^(.*)$/;
+ $path = $1;
mkdir $path, 0770;
my $path = "/var/spool/asterisk/voicemail/$context/$mbox/$oldfolder";
opendir(DIR, $path) || die("Unable to open directory\n");
@@ -742,6 +744,10 @@
my ($orig, $new) = @_;
my $res;
my $data;
+ $orig =~ /^(.*)$/;
+ $orig = $1;
+ $new =~ /^(.*)$/;
+ $new = $1;
open(IN, "<$orig") || die("Unable to open '$orig'\n");
open(OUT, ">$new") || DIE("Unable to open '$new'\n");
while(($res = sysread(IN, $data, 4096)) > 0) {
@@ -788,8 +794,12 @@
}
my $path = "/var/spool/asterisk/voicemail/$context/$newmbox";
+ $path =~ /^(.*)$/;
+ $path = $1;
mkdir $path, 0770;
my $path = "/var/spool/asterisk/voicemail/$context/$newmbox/INBOX";
+ $path =~ /^(.*)$/;
+ $path = $1;
mkdir $path, 0770;
my $path = "/var/spool/asterisk/voicemail/$context/$mbox/$oldfolder";
opendir(DIR, $path) || die("Unable to open directory\n");
More information about the svn-commits
mailing list