protected function validateShortName($shortName, $testForValidNewName = true)
 {
     $shortNameValid = true;
     if (!GcrEschoolTable::isShortNameValid($shortName)) {
         $this->formErrors['short_nameSize'] = 'eSchool URL must be 3-32 alphanumeric characters (1st character must be a letter).';
         $shortNameValid = false;
     }
     if ($testForValidNewName && GcrEschoolTable::isShortNameUsed($shortName)) {
         $this->formErrors['short_nameUsed'] = 'eSchool URL is already in use.';
         $shortNameValid = false;
     }
     if ($testForValidNewName && GcrEschoolTable::isShortNameReserved($shortName)) {
         $this->formErrors['short_nameReserved'] = 'eSchool URL is a reserved word.';
         $shortNameValid = false;
     }
     return $shortNameValid;
 }
 protected function validateEschoolShortName($shortName)
 {
     global $CFG;
     $shortNameValid = true;
     if (!GcrEschoolTable::isShortNameValid($shortName)) {
         $this->formErrors['short_nameSize'] = 'eClassroom URL must be 2-32 alphanumeric characters (1st character must be a letter).';
         $shortNameValid = false;
     }
     if (GcrEschoolTable::isShortNameUsed($shortName)) {
         $app = GcrInstitutionTable::getApp($shortName);
         if (!$CFG->current_app->hasPrivilege('GCUser') || $app->isMahara()) {
             $this->formErrors['short_nameUsed'] = 'eClassroom URL is already in use.';
             $shortNameValid = false;
         }
     }
     if (GcrEschoolTable::isShortNameReserved($shortName)) {
         $this->formErrors['short_nameReserved'] = 'eClassroom URL is a reserved word.';
         $shortNameValid = false;
     }
     return $shortNameValid;
 }