Index: branches/unlabeled/unlabeled-1.65.2/kernel/units/users/users_event_handler.php =================================================================== diff -u -r6487 -r6675 --- branches/unlabeled/unlabeled-1.65.2/kernel/units/users/users_event_handler.php (.../users_event_handler.php) (revision 6487) +++ branches/unlabeled/unlabeled-1.65.2/kernel/units/users/users_event_handler.php (.../users_event_handler.php) (revision 6675) @@ -357,7 +357,7 @@ $object =& $event->getObject(); $this->Application->SetVar('u_id', $object->GetID() ); - if($object->GetDBField('Status') == STATUS_ACTIVE) + if($object->GetDBField('Status') == STATUS_ACTIVE && !$this->Application->ConfigValue('User_Password_Auto')) { $email_as_login = $this->Application->ConfigValue('Email_As_Login'); list($login_field, $submit_field) = $email_as_login ? Array('Email', 'email') : Array('Login', 'login'); @@ -448,10 +448,16 @@ $cs_helper =& $this->Application->recallObject('CountryStatesHelper'); $cs_helper->CheckStateField($event, 'State', 'Country'); - parent::OnCreate($event); - $object =& $event->getObject( Array('skip_autoload' => true) ); + if ($this->Application->ConfigValue('User_Password_Auto')) { + $pass = makepassword4(rand(5,8)); + $object->SetField('Password', $pass); + $object->SetField('VerifyPassword', $pass); + $this->Application->SetVar('user_password',$pass); + } + parent::OnCreate($event); + $this->Application->SetVar('u_id', $object->getID() ); $this->setNextTemplate($event); Index: branches/unlabeled/unlabeled-1.47.2/core/kernel/startup.php =================================================================== diff -u -r6445 -r6675 --- branches/unlabeled/unlabeled-1.47.2/core/kernel/startup.php (.../startup.php) (revision 6445) +++ branches/unlabeled/unlabeled-1.47.2/core/kernel/startup.php (.../startup.php) (revision 6675) @@ -1,6 +1,4 @@ 'PortalUserId', - + 'StatusField' => Array('Status'), - + 'TitleField' => 'Login', - + 'ItemType' => 6, // used for custom fields only (on user's case) - + 'StatisticsInfo' => Array( 'pending' => Array( 'icon' => 'icon16_user_pending.gif', @@ -64,25 +64,25 @@ 'status' => STATUS_PENDING, ), ), - + 'TitlePresets' => Array( 'default' => Array( 'new_status_labels' => Array('u'=>'!la_title_Adding_User!'), 'edit_status_labels' => Array('u'=>'!la_title_Editing_User!'), 'new_titlefield' => Array('u'=>'!la_title_New_User!'), ), - + 'users_list' => Array('prefixes' => Array('u_List'), 'format' => "!la_title_Users! (#u_recordcount#)"), - + 'users_edit' => Array('prefixes' => Array('u'), 'format' => "#u_status# '#u_titlefield#' - !la_title_General!"), - + 'users_select' => Array('prefixes' => Array('u_List'), 'format' => "!la_title_Users! (#u_recordcount#) - !la_title_SelectUser!"), - + 'tree_users' => Array('format' => '!la_section_overview!'), ), - + 'PermSection' => Array('main' => 'in-portal:user_list', 'email' => 'in-portal:user_email', 'custom' => 'in-portal:user_custom'), - + 'Sections' => Array( 'in-portal:users' => Array( 'parent' => 'in-portal:root', @@ -93,7 +93,7 @@ 'priority' => 2, 'type' => stTREE, ), - + 'in-portal:user_list' => Array( 'parent' => 'in-portal:users', 'icon' => 'users', @@ -103,7 +103,7 @@ 'priority' => 1, 'type' => stTREE, ), - + 'in-portal:configure_users' => Array( 'parent' => 'in-portal:users', 'icon' => 'users_settings', @@ -113,7 +113,7 @@ 'priority' => 3, 'type' => stTREE, ), - + 'in-portal:user_email' => Array( 'parent' => 'in-portal:users', 'icon' => 'settings_email', @@ -123,7 +123,7 @@ 'priority' => 4, 'type' => stTREE, ), - + 'in-portal:user_custom' => Array( 'parent' => 'in-portal:users', 'icon' => 'settings_custom', @@ -133,7 +133,7 @@ 'priority' => 5, 'type' => stTREE, ), - + 'in-portal:user_banlist' => Array( 'parent' => 'in-portal:users', 'icon' => 'banlist', @@ -143,22 +143,22 @@ 'priority' => 6, 'type' => stTREE, ), - ), - + ), + 'TableName' => TABLE_PREFIX.'PortalUser', 'ListSQLs' => Array( '' => ' SELECT %1$s.* %2$s FROM %1$s LEFT JOIN '.TABLE_PREFIX.'UserGroup ug ON %1$s.PortalUserId = ug.PortalUserId AND ug.PrimaryGroup = 1 LEFT JOIN '.TABLE_PREFIX.'PortalGroup g ON ug.GroupId = g.GroupId LEFT JOIN '.TABLE_PREFIX.'%3$sPortalUserCustomData cust ON %1$s.ResourceId = cust.ResourceId', ), - + 'ItemSQLs' => Array( '' => ' SELECT %1$s.* %2$s FROM %1$s LEFT JOIN '.TABLE_PREFIX.'UserGroup ug ON %1$s.PortalUserId = ug.PortalUserId AND ug.PrimaryGroup = 1 LEFT JOIN '.TABLE_PREFIX.'PortalGroup g ON ug.GroupId = g.GroupId LEFT JOIN '.TABLE_PREFIX.'%3$sPortalUserCustomData cust ON %1$s.ResourceId = cust.ResourceId', ), - + 'ListSortings' => Array( '' => Array( 'Sorting' => Array('Login' => 'asc'), @@ -171,20 +171,20 @@ 'Groups' => Array( Array('mode' => 'AND', 'filters' => Array(0,1,2), 'type' => WHERE_FILTER), ), - + 'Filters' => Array( 0 => Array('label' =>'la_Enabled', 'on_sql' => '', 'off_sql' => '%1$s.Status != 1' ), 1 => Array('label' => 'la_Disabled', 'on_sql' => '', 'off_sql' => '%1$s.Status != 0' ), 2 => Array('label' => 'la_Pending', 'on_sql' => '', 'off_sql' => '%1$s.Status != 2' ), ) ), - + 'CalculatedFields' => Array( '' => Array( 'PrimaryGroup' => 'g.Name', ), ), - + 'Fields' => Array ( 'PortalUserId' => Array(), @@ -248,7 +248,7 @@ 'CreatedOn_formatted' => Array('title' => 'la_col_CreatedOn', 'sort_field' => 'CreatedOn'), ), ), - + 'UserSelector' => Array( 'Icons' => Array(0 => 'icon16_user_disabled.gif', 1 => 'icon16_user.gif', 2 => 'icon16_user_pending.gif'), 'Fields' => Array( Index: branches/unlabeled/unlabeled-1.108.2/admin/install.php =================================================================== diff -u -r6430 -r6675 --- branches/unlabeled/unlabeled-1.108.2/admin/install.php (.../install.php) (revision 6430) +++ branches/unlabeled/unlabeled-1.108.2/admin/install.php (.../install.php) (revision 6675) @@ -120,6 +120,7 @@ set_ini_value("Database", "DBUserPassword", ""); set_ini_value("Database", "DBName", ""); set_ini_value("Module Versions", "In-Portal", ""); + save_values(); } } Index: branches/unlabeled/unlabeled-1.26.2/kernel/units/email_events/email_events_event_handler.php =================================================================== diff -u -r6436 -r6675 --- branches/unlabeled/unlabeled-1.26.2/kernel/units/email_events/email_events_event_handler.php (.../email_events_event_handler.php) (revision 6436) +++ branches/unlabeled/unlabeled-1.26.2/kernel/units/email_events/email_events_event_handler.php (.../email_events_event_handler.php) (revision 6675) @@ -196,6 +196,8 @@ $parser_params = $this->Application->Parser->Params; $direct_send_params['message_text'] = $message_body_additional; $this->Application->Parser->Params = array_merge_recursive2($this->Application->Parser->Params, $direct_send_params); + $message_template = str_replace('Application->Parser->Parse($message_template, 'email_template', 0); $this->Application->Parser->Params = $parser_params; Index: branches/unlabeled/unlabeled-1.11.2/kernel/units/users/users_item.php =================================================================== diff -u -r6582 -r6675 --- branches/unlabeled/unlabeled-1.11.2/kernel/units/users/users_item.php (.../users_item.php) (revision 6582) +++ branches/unlabeled/unlabeled-1.11.2/kernel/units/users/users_item.php (.../users_item.php) (revision 6675) @@ -81,8 +81,14 @@ switch( $this->GetDBField('Status') ) { case 1: - $this->Application->EmailEventAdmin('USER.ADD', $this->GetID() ); - $this->Application->EmailEventUser('USER.ADD', $this->GetID() ); + if ($this->Application->ConfigValue('User_Password_Auto')) { + $this->Application->EmailEventAdmin('USER.VALIDATE', $this->GetID() ); + $this->Application->EmailEventUser('USER.VALIDATE', $this->GetID() ); + } + else { + $this->Application->EmailEventAdmin('USER.ADD', $this->GetID() ); + $this->Application->EmailEventUser('USER.ADD', $this->GetID() ); + } break; case 2: