[asterisk-commits] seanbright: branch 1.6.0 r143738 - in /branches/1.6.0: ./ contrib/scripts/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Sep 19 19:54:16 CDT 2008


Author: seanbright
Date: Fri Sep 19 19:54:15 2008
New Revision: 143738

URL: http://svn.digium.com/view/asterisk?view=rev&rev=143738
Log:
Merged revisions 143737 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/trunk

................
r143737 | seanbright | 2008-09-19 20:52:20 -0400 (Fri, 19 Sep 2008) | 17 lines

Merged revisions 143736 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r143736 | seanbright | 2008-09-19 20:50:10 -0400 (Fri, 19 Sep 2008) | 9 lines

Make vmail.cgi work with mailboxes defined in users.conf, too.

(closes issue #13187)
Reported by: netvoice
Patches:
      20080911__bug13187.diff.txt uploaded by Corydon76 (license 14)
      (Slightly modified to take alchamist's comments on mantis into account)
Tested by: msales, alchamist, seanbright

........

................

Modified:
    branches/1.6.0/   (props changed)
    branches/1.6.0/contrib/scripts/vmail.cgi

Propchange: branches/1.6.0/
------------------------------------------------------------------------------
Binary property 'trunk-merged' - no diff available.

Modified: branches/1.6.0/contrib/scripts/vmail.cgi
URL: http://svn.digium.com/view/asterisk/branches/1.6.0/contrib/scripts/vmail.cgi?view=diff&rev=143738&r1=143737&r2=143738
==============================================================================
--- branches/1.6.0/contrib/scripts/vmail.cgi (original)
+++ branches/1.6.0/contrib/scripts/vmail.cgi Fri Sep 19 19:54:15 2008
@@ -193,7 +193,40 @@
 		}
 	}
 	close(VMAIL);
-	return ("", $category);
+	return check_login_users();
+}
+
+sub check_login_users {
+	my ($mbox, $context) = split(/\@/, param('mailbox'));
+	my $pass = param('password');
+	my ($found, $fullname) = (0, "");
+	open VMAIL, "</etc/asterisk/users.conf";
+	while (<VMAIL>) {
+		chomp;
+		if (m/\[(.*)\]/) {
+			if ($1 eq $mbox) {
+				$found = 1;
+			} elsif ($found == 2) {
+				close VMAIL;
+				return (($fullname ? $fullname : "Extension $mbox in $context"), $context);
+			} else {
+				$found = 0;
+			}
+		} elsif ($found) {
+			my ($var, $value) = split /\s*=\s*/, $_, 2;
+			if ($var eq 'vmsecret' and $value eq $pass) {
+				$found = 2;
+			} elsif ($var eq 'fullname') {
+				$fullname = $value;
+				if ($found == 2) {
+					close VMAIL;
+					return ($fullname, $context);
+				}
+			}
+		}
+	}
+	close VMAIL;
+	return ("", "");
 }
 
 sub validmailbox($$$$)




More information about the asterisk-commits mailing list