| Author | 
         | 
         
      
        
         
         mattj Newbie 
          
 
  Joined: 15 September 2010
 Online Status: Offline Posts: 1
          | 
        
         
          
           | Posted: 15 September 2010 at 10:42am | IP Logged
		     | 
                    
            		  
           | 
           
          
           
  | 
           
          
I'm trying to sift through the source to figure out how to create a new user and I'm close! When I run the script below it inserts an account into awm_accounts, and it creates a user in a_users. However it doesn't set the awm_account's user_id, it allows the webmail page to load but i get "Can't get message list". Any input would be most appreciated.
 
 
 
 $null = null;
 $acct = new Account();
 $user = new User();
 $dbStorage = DbStorageCreator::CreateDatabaseStorage($null);
 
 $acct->Email = $email;
 $acct->MailIncLogin = $login;
 $acct->MailIncHost = $pop3;
 $acct->MailIncPassword = $password;
 $acct->MailIncPort = 110;
 $acct->MailOutLogin = $login;
 $acct->MailOutHost = $smtp;
 $acct->MailOutPassword = $password;
 $acct->MailOutPort = 25;
 $acct->MailProtocol = MAILPROTOCOL_POP3;
 $acct->MailOutAuthentication = true;
 $acct->DefaultAccount = 1;
 
 
 $dbStorage->InsertUserData($acct);
 $dbStorage->InsertAccountData($acct);
 $dbStorage->InsertSettings($acct);
 
         | 
       
       
        | Back to Top | 
         
          
         | 
       
       
       
        |   |