Search
j0ke.net Open Build Service
>
Projects
>
server:mail
>
vqadmin
> vqadmin-2.3.6-valias.patch
Sign Up
|
Log In
Username
Password
Cancel
Overview
Repositories
Revisions
Requests
Users
Advanced
Attributes
Meta
File vqadmin-2.3.6-valias.patch of Package vqadmin
diff -Naur vqadmin-2.3.6/user.c vqadmin-2.3.6-new/user.c --- vqadmin-2.3.6/user.c 2005-10-07 04:29:48.000000000 +0300 +++ vqadmin-2.3.6-new/user.c 2005-10-07 04:27:43.000000000 +0300 @@ -411,66 +411,25 @@ printf("<HR>\n"); printf("<B>Alias/Forwards for %s</B>\n", domain); printf("<table cellspacing=5>\n"); - printf("<tr><th align=left><FONT face=%s color=\"%s\"><B>Name</B></FONT>\n", - face, fgcolor); - printf("</th><th><FONT face=%s color=\"%s\"><B>Alias/Forward</B></FONT></th><BR></tr>\n", face, fgcolor); - chdir(dir); - mydir = opendir("."); - count = 0; - while( (mydirent=readdir(mydir)) != NULL ) { - if ( strncmp(".qmail-", mydirent->d_name, 7) == 0 ) { - - if ( strstr(mydirent->d_name, "-owner") != NULL ) continue; - if ( strstr( mydirent->d_name, "-default") != NULL ) continue; - - fs=fopen(mydirent->d_name,"r"); - memset(tmpbuf,0,sizeof(tmpbuf)); - if ( fgets( tmpbuf, 156, fs ) != NULL ) { - if ( tmpbuf[0] == '|' ) { - fclose(fs); - continue; - } - } - - for(i=7,j=0;j<156-1&&mydirent->d_name[i]!=0;++i,++j) { - workdir[j] = mydirent->d_name[i]; - } - workdir[j] = 0; - ++count; - - printf("<tr><td align=left><FONT face=%s color=\"%s\">%s@%s</td>", - face, fgcolor, workdir, domain); - - printf("<td align=left>\n"); - fs=fopen(mydirent->d_name,"r"); - while ( fgets( tmpbuf, 156, fs ) != NULL ) { - if ( tmpbuf[0] == '#' || isspace(tmpbuf[0]) ) { - printf("<FONT face=%s color=\"%s\"> </FONT><BR>\n", - face, fgcolor); - } else if ( strstr(tmpbuf, "@") != NULL ) { - if ( tmpbuf[0] == '&' ) i = 1; - else i = 0; - - printf("<FONT face=%s color=\"%s\">forward: %s</FONT><BR>\n", - face, fgcolor, &tmpbuf[i]); - } else { - tmpstr = &tmpbuf[strlen(tmpbuf)-2]; - *tmpstr = 0; - while (*tmpstr!='/') --tmpstr; - *tmpstr = 0; - while (*tmpstr!='/') --tmpstr; - ++tmpstr; + + char Alias[256]; + char *tmpalias; + + tmpalias = valias_select_all( Alias, domain ); + + if (tmpalias != NULL ) { + printf("<tr><th align=left><FONT face=%s color=\"%s\"><B>Name</B></FONT>\n", face, fgcolor); + printf("</th><th><FONT face=%s color=\"%s\"><B>Alias/Forward</B></FONT></th><BR></tr>\n", face, fgcolor); + } - printf("<FONT face=%s color=\"%s\">alias: %s</FONT><BR>\n", - face, fgcolor, tmpstr); - } - } - printf("</td></tr>\n"); - - fclose(fs); - } + while (tmpalias != NULL ) { + printf("<tr><td align=left><FONT face=%s color=\"%s\">%s@%s</FONT></td>", face, fgcolor, Alias, domain); + printf("<td align=left>\n"); + printf("<FONT face=%s color=\"%s\">forward:  %s</FONT><BR>\n", face, fgcolor, tmpalias); + printf("</td></tr>\n"); + tmpalias = valias_select_all_next(Alias); } - closedir(mydir); + printf("</table>\n"); printf("<HR>\n");