Chinaunix首页 | 论坛 | 博客
  • 博客访问: 5272488
  • 博文数量: 1144
  • 博客积分: 11974
  • 博客等级: 上将
  • 技术积分: 12312
  • 用 户 组: 普通用户
  • 注册时间: 2005-04-13 20:06
文章存档

2017年(2)

2016年(14)

2015年(10)

2014年(28)

2013年(23)

2012年(29)

2011年(53)

2010年(86)

2009年(83)

2008年(43)

2007年(153)

2006年(575)

2005年(45)

分类: LINUX

2006-12-09 14:18:19

Hi lists,

I had remodeled for qmailadmin-1.2.9  because it was on business
needs. The account of two or more postmasters can be made for
one domain.

POSTMASTER ACCOUNTS are "postmaster" and starting by
"postmaster-".

For example, if an account "postmaster-hoge" is made, this postmaster-hoge has same authority as "postmaster".

Thanks.

-----------------------------------------------------------
diff -r -u qmailadmin-1.2.9.org/auth.c qmailadmin-1.2.9/auth.c
--- qmailadmin-1.2.9.org/auth.c 2005-01-24 02:35:11.000000000 +0900
+++ qmailadmin-1.2.9/auth.c 2006-01-13 18:33:24.217852035 +0900
@@ -41,9 +41,11 @@
  struct vqpasswd *pw;
 {
  FILE *fs;
+ FILE *fs2;
  time_t time1;
  time_t time2;
  char ip_value[MAX_BUFF];
+ char PLFile[MAX_BUFF];
 
   if( chdir(RealDir) < 0 ){
     snprintf (StatusMessage, sizeof(StatusMessage), "%s %s\n", html_text[171], RealDir);
@@ -52,6 +54,19 @@
     exit(0);
   }
 
+  if ( (strcmp(Username,"postmaster")==0) ||
+       (strncmp(Username,"postmaster-", 11)==0)) {
+    snprintf(PLFile, sizeof(PLFile), "%s/%s.qw", RealDir, Time);
+    fs2 = fopen(PLFile, "r");
+    if ( fs2 == NULL ) {
+      snprintf (StatusMessage, sizeof(StatusMessage), "%s\n", html_text[172]);
+      show_login();
+      vclose();
+      exit(0);
+    }
+    fclose(fs2);
+  }
+
   snprintf(TmpBuf1, sizeof(TmpBuf1), "%s/" MAILDIR "/%s.qw", pw->pw_dir, Time);
 
   fs = fopen(TmpBuf1, "r");
@@ -95,9 +110,11 @@
  struct vqpasswd *pw;
 {
  FILE *fs;
+ FILE *fs2;
  time_t time1;
  time_t time2;
  char ip_value[MAX_BUFF];
+ char PLFile[MAX_BUFF];
 
   if ( chdir(RealDir) < 0 ) {
     snprintf (StatusMessage, sizeof(StatusMessage), "%s %s\n", html_text[171], RealDir );
@@ -106,6 +123,19 @@
     exit(0);
   }
 
+  if ( (strcmp(Username,"postmaster")==0) ||
+       (strncmp(Username,"postmaster-", 11)==0)) {
+    snprintf(PLFile, sizeof(PLFile), "%s/%s.qw", RealDir, Time);
+    fs2 = fopen(PLFile, "r");
+    if ( fs2 == NULL ) {
+      snprintf (StatusMessage, sizeof(StatusMessage), "%s\n", html_text[172]);
+      show_login();
+      vclose();
+      exit(0);
+    }
+    fclose(fs2);
+  }
+
   snprintf(TmpBuf1, sizeof(TmpBuf1), "%s/" MAILDIR "/%s.qw", pw->pw_dir, Time);
 
   fs = fopen(TmpBuf1, "r");
@@ -153,7 +183,8 @@
   vpw = vauth_getpw(Username, Domain);
   AdminType = NO_ADMIN;
   if ( strlen(Domain) > 0 ) {
-    if ( strcmp(Username,"postmaster")==0 ) {
+    if ( (strcmp(Username,"postmaster")==0) ||
+ (strncmp(Username,"postmaster-", 11)==0)) {
       AdminType = DOMAIN_ADMIN;
 #ifdef VQPASSWD_HAS_PW_FLAGS
     } else if ( vpw->pw_flags & QA_ADMIN ) {
@@ -166,3 +197,4 @@
     }
   }
 }
+
diff -r -u qmailadmin-1.2.9.org/qmailadmin.c qmailadmin-1.2.9/qmailadmin.c
--- qmailadmin-1.2.9.org/qmailadmin.c 2005-08-11 02:42:49.000000000 +0900
+++ qmailadmin-1.2.9/qmailadmin.c 2006-01-13 18:31:14.235969767 +0900
@@ -283,6 +283,14 @@
          /* show the main menu for domain admins, modify user page
             for regular users */
          if (AdminType == DOMAIN_ADMIN) {
+    char PLFile[MAX_BUFF];
+    snprintf (PLFile, sizeof(PLFile), "%s", RealDir);
+    del_id_files(PLFile);
+
+    snprintf (PLFile, sizeof(PLFile), "%s/%u.qw", RealDir, (unsigned int) Mytime);
+    fs = fopen(PLFile,"w");
+    fputs(PLFile,fs);
+    fclose(fs);
            show_menu(Username, Domain, Mytime);
          } else {
            strcpy (ActionUser, Username);


--
Osamu Katagiri
阅读(1121) | 评论(0) | 转发(0) |
0

上一篇:mysql igenus出错问题

下一篇:razor-agent.conf

给主人留下些什么吧!~~