Add optional password suffix for inital student passwords
authorsstamer <s.stamer@metaways.de>
Fri, 5 Jun 2015 10:37:09 +0000 (12:37 +0200)
committerPhilipp Schüle <p.schuele@metaways.de>
Thu, 25 Jun 2015 10:33:19 +0000 (12:33 +0200)
Change-Id: I70dec4219b9ccc6a7dfddac228db30930b24b443
Reviewed-on: http://gerrit.tine20.com/customers/1965
Tested-by: Jenkins CI (http://ci.tine20.com/)
Reviewed-by: Philipp Schüle <p.schuele@metaways.de>
tine20/Courses/Config.php
tine20/Courses/Controller/Course.php

index 2214b6e..1a5b970 100644 (file)
@@ -74,6 +74,13 @@ class Courses_Config extends Tinebase_Config_Abstract
     const STUDENT_LOGINNAME_PREFIX = 'student_loginname_prefix';
     
     /**
+     * students password suffix
+     *
+     * @var string
+     */
+    const STUDENT_PASSWORD_SUFFIX = 'password_suffix';
+    
+    /**
     * default department
     *
     * @var string
@@ -133,6 +140,13 @@ class Courses_Config extends Tinebase_Config_Abstract
             'type'                  => 'int',
             'clientRegistryInclude' => TRUE,
         ),
+        self::STUDENT_PASSWORD_SUFFIX => array(
+                //_('Students password suffix')
+                'label'                 => 'Students password suffix',
+                'description'           => 'Students password suffix',
+                'type'                  => 'string',
+                'clientRegistryInclude' => TRUE,
+        ),
         self::STUDENTS_USERNAME_SCHEMA => array(
         //_('Student username schema')
             'label'                 => 'Student username schema',
index 92efa21..294c03c 100644 (file)
@@ -494,7 +494,7 @@ class Courses_Controller_Course extends Tinebase_Controller_Record_Abstract
             'accountEmailDomain'            => (isset($this->_config->domain)) ? $this->_config->domain : '',
             'accountHomeDirectoryPrefix'    => (isset($this->_config->basehomedir)) ? $this->_config->basehomedir . $schoolName . '/'. $course->name . '/' : '',
             'userNameSchema'                => $this->_config->get(Courses_Config::STUDENTS_USERNAME_SCHEMA, 1),
-            'password'                      => strtolower($course->name),
+            'password'                      => strtolower($course->name) . $this->_config->get(Courses_Config::STUDENT_PASSWORD_SUFFIX, ''),
             'course'                        => $course,
             'accountLoginShell'             => '/bin/false',
             'samba'                         => (isset($this->_config->samba)) ? array(