Merge branch '2013.10' into 2014.11
authorPhilipp Schüle <p.schuele@metaways.de>
Wed, 2 Sep 2015 14:05:32 +0000 (16:05 +0200)
committerPhilipp Schüle <p.schuele@metaways.de>
Wed, 2 Sep 2015 14:05:32 +0000 (16:05 +0200)
1  2 
tine20/Courses/Controller/Course.php

@@@ -468,7 -468,7 +468,7 @@@ class Courses_Controller_Course extend
          // check if group exists, too
          $group = $this->_groupController->get($course->group_id);
          
 -        $importer = Admin_Import_Csv::createFromDefinition($definition, $this->_getNewUserConfig($course));
 +        $importer = Admin_Import_User_Csv::createFromDefinition($definition, $this->_getNewUserConfig($course));
          $result = $importer->importFile($tempFile->path);
          
          $groupMembers = $this->_groupController->getGroupMembers($course->group_id);
              '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) . $this->_config->get(Courses_Config::STUDENT_PASSWORD_SUFFIX, ''),
+             'password'                      => $this->getStudentPassword($course->name),
              'course'                        => $course,
              'accountLoginShell'             => '/bin/false',
              'samba'                         => (isset($this->_config->samba)) ? array(
          );
      }
      
+     
+     /**
+      * Returns default student password
+      * 
+      * @param string $courseName
+      * @return string
+      */
+     public function getStudentPassword($courseName)
+     {
+         return strtolower($courseName) . $this->_config->get(Courses_Config::STUDENT_PASSWORD_SUFFIX, '');
+     }
+     
      /**
       * add new member to course
       *