Re: [vchkpw] vpopmaild - return from login, and others

2004-04-06 Thread Ken Jones
On Monday 05 April 2004 11:09 pm, Rick Widmer wrote:
 When I login, the following information is returned:

 vpopmail_dir /mail
 uid 77
 gid 72
 name postmaster
 comment Postmaster
 quota NOQUOTA
 dir /mail/domains/test.com/postmaster
 encrypted_password $1$zkJe.3SH$7HOl1RbwfKcibL67iXjsh/
 clear_text_password password
 domain_admin_privleges
 system_admin_privleges


 Everything except *_privleges is a name-value pair with a space
 separator.  It might be handy to add space 1 to each of the bitmap
 fields that can appear here.  Like this:

 domain_admin_privleges 1
 system_admin_privleges 1

Excellent idea. I'll put this in.


 That way if I pass the whole list through a function that explodes on
 the space, then packs the name value pairs into an (associaive) array
 these entries will be 'true' to PHP. [1] Without the 1, I have to
 identify them and handle them as special cases.



 I don't know if this is a good idea or not, but it might be handy if you
 always listed all of the bitmap value names with a 0 or 1.  That allows
 for the possibility of generating the PHP fields from the list of bitmap
 values returned.

I like this idea too. The only downsize I see is the extra lines of
information that are default values. The upside is the client does
not need to preset their array with suspect default values, causing
disagreement on values.


 no_password_change 0
 no_pop 0
 no_webmail 0
 no_imap 0
 bounce_mail 0
 no_relay 0
 no_dialup 0
 user_flag_0 0
 user_flag_1 0
 user_flag_2 0
 user_flag_3 0
 no_smpt 0
 domain_admin_privleges 1
 override_domain_limits 0
 no_spamassasin 0
 delete_spam 0
 system_admin_privleges 0

 Would anyone use that information?


 Rick

 ---


 [1]  This code:

 while( list( , $Line ) = each( $ReturnedLines )) {
 list( $Name, $Value ) = explode( ' ', $Line );
 $LoginUser[ $Name ] = $Value;
 }


 turns the entry listed above into the following PHP array:

 LoginUser = array(
 'vpopmail_dir'   =  '/mail',
 'uid'= '77
 'gid'= '72
 'name'   = 'postmaster
 'comment'= 'Postmaster
 'quota'  = 'NOQUOTA
 'dir'= '/mail/domains/test.com/postmaster
 'encrypted_password' = '$1$zkJe.3SH$7HOl1RbwfKcibL67iXjsh/
 'clear_text_password'= 'password',
 'domain_admin_privleges' = '',
 'system_admin_privleges' = '',
 );


Re: [vchkpw] vpopmaild - return from login, and others

2004-04-06 Thread Marcin Soltysiak

- Original Message - 
From: Rick Widmer [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, April 06, 2004 6:09 AM
Subject: [vchkpw] vpopmaild - return from login, and others


 When I login, the following information is returned:

 vpopmail_dir /mail
 uid 77
 gid 72
 name postmaster
 comment Postmaster
 quota NOQUOTA
 dir /mail/domains/test.com/postmaster
 encrypted_password $1$zkJe.3SH$7HOl1RbwfKcibL67iXjsh/
 clear_text_password password
 domain_admin_privleges
 system_admin_privleges


 Everything except *_privleges is a name-value pair with a space
 separator.  It might be handy to add space 1 to each of the bitmap
 fields that can appear here.  Like this:

 domain_admin_privleges 1
 system_admin_privleges 1

 That way if I pass the whole list through a function that explodes on
 the space, then packs the name value pairs into an (associaive) array
 these entries will be 'true' to PHP. [1] Without the 1, I have to
 identify them and handle them as special cases.



 I don't know if this is a good idea or not, but it might be handy if you
 always listed all of the bitmap value names with a 0 or 1.  That allows
 for the possibility of generating the PHP fields from the list of bitmap
 values returned.


 no_password_change 0
 no_pop 0
 no_webmail 0
 no_imap 0
 bounce_mail 0
 no_relay 0
 no_dialup 0
 user_flag_0 0
 user_flag_1 0
 user_flag_2 0
 user_flag_3 0
 no_smpt 0
 domain_admin_privleges 1
 override_domain_limits 0
 no_spamassasin 0
 delete_spam 0
 system_admin_privleges 0

 Would anyone use that information?


 Rick

 --
-


 [1]  This code:

 while( list( , $Line ) = each( $ReturnedLines )) {
 list( $Name, $Value ) = explode( ' ', $Line );
 $LoginUser[ $Name ] = $Value;
 }


 turns the entry listed above into the following PHP array:

 LoginUser = array(
 'vpopmail_dir'   =  '/mail',
 'uid'= '77
 'gid'= '72
 'name'   = 'postmaster
 'comment'= 'Postmaster
 'quota'  = 'NOQUOTA
 'dir'= '/mail/domains/test.com/postmaster
 'encrypted_password' = '$1$zkJe.3SH$7HOl1RbwfKcibL67iXjsh/
 'clear_text_password'= 'password',
 'domain_admin_privleges' = '',
 'system_admin_privleges' = '',
 );


anyway if you check like:

if($LoginUser['system_admin_privileges']) {
  .
}

it doesnt quote matter if it is set to 0 or not set.

Solt



[vchkpw] vpopmaild - return from login, and others

2004-04-05 Thread Rick Widmer
When I login, the following information is returned:

   vpopmail_dir /mail
   uid 77
   gid 72
   name postmaster
   comment Postmaster
   quota NOQUOTA
   dir /mail/domains/test.com/postmaster
   encrypted_password $1$zkJe.3SH$7HOl1RbwfKcibL67iXjsh/
   clear_text_password password
   domain_admin_privleges
   system_admin_privleges
Everything except *_privleges is a name-value pair with a space 
separator.  It might be handy to add space 1 to each of the bitmap 
fields that can appear here.  Like this:

   domain_admin_privleges 1
   system_admin_privleges 1
That way if I pass the whole list through a function that explodes on 
the space, then packs the name value pairs into an (associaive) array 
these entries will be 'true' to PHP. [1] Without the 1, I have to 
identify them and handle them as special cases.



I don't know if this is a good idea or not, but it might be handy if you 
always listed all of the bitmap value names with a 0 or 1.  That allows 
for the possibility of generating the PHP fields from the list of bitmap 
values returned.

   no_password_change 0
   no_pop 0
   no_webmail 0
   no_imap 0
   bounce_mail 0
   no_relay 0
   no_dialup 0
   user_flag_0 0
   user_flag_1 0
   user_flag_2 0
   user_flag_3 0
   no_smpt 0
   domain_admin_privleges 1
   override_domain_limits 0
   no_spamassasin 0
   delete_spam 0
   system_admin_privleges 0
Would anyone use that information?

Rick

---

[1]  This code:

while( list( , $Line ) = each( $ReturnedLines )) {
   list( $Name, $Value ) = explode( ' ', $Line );
   $LoginUser[ $Name ] = $Value;
   }
turns the entry listed above into the following PHP array:

LoginUser = array(
   'vpopmail_dir'   =  '/mail',
   'uid'= '77
   'gid'= '72
   'name'   = 'postmaster
   'comment'= 'Postmaster
   'quota'  = 'NOQUOTA
   'dir'= '/mail/domains/test.com/postmaster
   'encrypted_password' = '$1$zkJe.3SH$7HOl1RbwfKcibL67iXjsh/
   'clear_text_password'= 'password',
   'domain_admin_privleges' = '',
   'system_admin_privleges' = '',
   );