Code

Avoid empty roles
authorcajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 3 Jul 2009 15:25:25 +0000 (15:25 +0000)
committercajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 3 Jul 2009 15:25:25 +0000 (15:25 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@13884 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/roleManagement/admin/roleManagement/class_roleGeneric.inc
gosa-plugins/roleManagement/admin/roleManagement/roleGeneric.tpl

index ee30124ec0ae3e9379ae3c1a037b4c41cf38bbb8..58b71a4a5f27f7f191a19dc281def81b050c85fa 100644 (file)
@@ -196,6 +196,11 @@ class roleGeneric extends plugin {
       $message[]= msgPool::permMove();
     }
 
+    /* must: cn */
+    if ($this->cn == ""){
+      $message[]= msgPool::required(_("Name"));
+    }
+
     // Check if this name is uniq for roles.
     $ldap= $this->config->get_ldap_link();
     $ldap->cd($this->config->current['BASE']);
@@ -204,6 +209,7 @@ class roleGeneric extends plugin {
     if ($ldap->count() != 0 && ( $this->dn == 'new' || $this->cn != $this->orig_cn)){
       $message[]= msgPool::duplicated(_("Name"));
     }
+
     return($message);
   }
   
index 21c683edb5e5ef9fd755c91b9191cdbae2fbb6dc..46f5884dfa831fc51475a98b5f75840fc18e1c48 100644 (file)
@@ -8,7 +8,7 @@
 
       <table style='width:100%;'>
         <tr>
-          <td>{t}Name{/t}</td>
+          <td>{t}Name{/t}{$must}</td>
           <td>
             {render acl=$cnACL}
              <input type='text' value='{$cn}' name='cn'>