Code

Updated registration dialog.
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 8 Nov 2010 12:39:21 +0000 (12:39 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 8 Nov 2010 12:39:21 +0000 (12:39 +0000)
-Sorted attributes
-Removed annonym auth

git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20202 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-core/plugins/generic/dashBoard/Register/class_RegistrationDialog.inc
gosa-core/plugins/generic/dashBoard/Register/register.tpl

index 189d4f71764da50cf51ecaea8263600e4402f7fc..72f0b4eaecbb3166538799070cc76cef985645f9 100644 (file)
@@ -12,7 +12,17 @@ class RegistrationDialog extends plugin
     protected $isRegistered = FALSE; 
     protected $step = 0;
 
-    public $attrs = array('mailAddress','surname','givenName', 'company', 'clients', 'knownFrom');
+    public $attrs = array(
+            
+            // User table
+            'uid','password','password_repeated','restoreQuestion','restoreAnswer',
+            'mailAddress','surname','givenName','newsletter',
+
+            // Contact table
+            'phone','contact','contact_mail','company','street',
+            'postal_code','city','trade','employees','description');
+
+
     protected $values = array();
 
     function __construct(&$config)
@@ -37,10 +47,31 @@ class RegistrationDialog extends plugin
     function registerNow()
     {
         if($this->selectedRegistrationType == "registered"){
+
+            // Register user 
             print_a($this->rpcHandle->registerUser('cajus', $this->values));
+
+            // Register Instance with User.
         }
 
-        $this->step = 200; // Awaiting verification
+        #$this->step = 200; // Awaiting verification
+    }
+
+
+    function check()
+    {
+        $message  = array();
+        if($this->step == 1){
+
+            // Checking for a valid 'uid'.
+            if(empty($this->values['uid'])) {
+                $message[] = msgPool::required(_("Account-ID"));
+            }elseif(!preg_match("/^[a-z0-9_-]+$/", $this->values['uid'])){
+                $message[] = msgPool::invalid(_("Account-ID"), $this->values['uid'],'/[a-z0-9_-]/');
+            }
+        }
+        
+        return($message);
     }
 
    
index 42eb5e1ecf0e6ada48614cc6887fafefdc31596f..55e3d977fb50387f54df814d7bce595ef338d1f0 100644 (file)
@@ -1,3 +1,5 @@
+<script type="text/javascript" src="include/pwdStrength.js"></script>
+
 <h3>{t}GOsa registration{/t}</h3>
 
 
@@ -10,6 +12,8 @@
         <p style='padding-left:20px;'>
             <!-- Add a descritive text later -->
         </p>
+
+        <!--
         <input type='radio' name='registrationType' value='annonym' id="registrationType_annonym"
             {if $default == "annonym"} checked {/if}><b><LABEL for="registrationType_annonym">{t}Annonym access{/t}</LABEL></b>
         <p style='padding-left:20px;'>
@@ -27,7 +31,7 @@
             <li>{t}The bugs you will report and the corresponding trace. You can select what information you want to send in.{/t}</li>
         </ul>
         </p>
-        
+        -->
         <input type='radio' name='registrationType' value='registered' id="registrationType_registered"
             {if $default == "registered"} checked {/if}><b><LABEL for="registrationType_registered">{t}Register{/t}</LABEL></b>
         <p style='padding-left:20px;'>
         <b>{t}Selected registration type:{/t} {$default}</b>
     {elseif $default == "registered"}
         
-        <p>
-            {t}Please fill in the fields below.{/t}
-            <br>
-            <i>({$must} {t}Required fields{/t})</i>
-        </p>
-
-
+        <h3>{t}Account settings{/t}</h3>
         <table style='width:100%;'>
+            <tr> 
+                <td style='width:220px;'><LABEL for="uid">{t}Login-ID{/t}{$must}</LABEL></td>
+                <td>
+                    <input type='text' name="uid" value="{$uid}" id="uid">
+                </td>
+            </tr>
             <tr> 
                 <td style='width:220px;'><LABEL for="mailAddress">{t}Mail-address{/t}{$must}</LABEL></td>
                 <td>
                     <input type='text' name="mailAddress" value="{$mailAddress}" id="mailAddress">
                 </td>
             </tr>
+        </table>
+
+        <hr>
+
+        <h3>{t}Password{/t}</h3>
+        <table style='width:100%;'>
             <tr> 
-                <td for="surname">{t}Surname{/t}{$must}</LABEL></td>
+                <td style='width:220px;'><LABEL for="password">{t}Password{/t}{$must}</LABEL></td>
                 <td>
-                    <input type='text' name="surname" value="{$surname}" id="surname">
+                    {factory type='password' name='password' id='password'
+                          onkeyup="testPasswordCss(\$('password').value)"}
+
                 </td>
             </tr>
-            <tr> 
-                <td for="givenName">{t}Given name{/t}{$must}</LABEL></td>
+            <tr>
+                <td></td>
                 <td>
-                    <input type='text' name="givenName" value="{$givenName}" id="givenName">
+                    <div style='width:200px'>
+                    <span id="meterEmpty" style="padding:0;margin:0;width:100%;
+                            background-color:#DC143C;display:block;height:7px;">
+                    <span id="meterFull" style="padding:0;margin:0;z-index:100;
+                            width:0;background-color:#006400;display:block;height:7px;"></span></span>
+                    </div>
                 </td>
             </tr>
             <tr> 
-                <td for="company">{t}Company{/t}{$must}</LABEL></td>
+                <td style='width:220px;'><LABEL for="password_repeated">{t}Password{/t} <i>({t}repeated{/t})</i>{$must}</LABEL></td>
                 <td>
-                    <input type='text' name="company" value="{$company}" id="company">
+                    {factory type='password' name='password_repeated' id='password_repeated'}
                 </td>
             </tr>
             <tr> 
-                <td for="clients">{t}Amount of managed clients{/t}{$must}</LABEL></td>
+                <td style='width:220px;'><LABEL for="restoreQuestion">{t}Password restore question{/t}{$must}</LABEL></td>
                 <td>
-                    <input type='text' name="clients" value="{$clients}" id="clients">
+                    <input type='text' style='width:400px' name="restoreQuestion" value="{$restoreQuestion}" id="restoreQuestion">
                 </td>
             </tr>
             <tr> 
-                <td for="knownFrom">{t}Where do you know GOsa from?{/t}{$must}</LABEL></td>
+                <td style='width:220px;'><LABEL for="restoreAnswer">{t}Password restore answer{/t}{$must}</LABEL></td>
                 <td>
-                    <input type='text' name="knownFrom" value="{$knownFrom}" id="knownFrom">
+                    <input type='text' name="restoreAnswer" value="{$restoreAnswer}" id="restoreAnswer">
                 </td>
             </tr>
         </table>
+        <hr>
        
+        <h3>{t}Personal information{/t}</h3>
+        <table style='width:100%;'>
+            <tr> 
+                <td style='width:220px;'><LABEL for="surname">{t}Surname{/t}{$must}</LABEL></td>
+                <td>
+                    <input type='text' name="surname" value="{$surname}" id="surname">
+                </td>
+            </tr>
+            <tr> 
+                <td style='width:220px;'><LABEL for="givenName">{t}Given name{/t}{$must}</LABEL></td>
+                <td>
+                    <input type='text' name="givenName" value="{$givenName}" id="givenName">
+                </td>
+            </tr>
+        </table>
+
+        <hr>
+        <h3>{t}Newsletter{/t}</h3>
+        <table style='width:100%;'>
+            <tr> 
+                <td style='width:220px;'><LABEL for="newsletter">{t}Newsletter{/t}</LABEL></td>
+                <td>
+                    <input type='checkbox' name="newsletter" value="1" {if $newsletter} checked {/if}id="newsletter">
+                </td>
+            </tr>
+        </table>
+        <hr>
+        <i>({$must} {t}Required fields{/t})</i>
+
 
     {/if}
 
         <button name='stepBack'>{msgPool type=backButton}</button>
         <button name='registerNow'>{msgPool type=okButton}</button>
     </div>
+    <script type="text/javascript">
+        focus_field('uid');
+    </script>
 {/if}
 
 {if $step == 2}
 {/if}
 
 {if $step == 200}
-   <h3>VERIFY TEXTS!!!</h3> You have reciefed a mail, bafasel, please click link and so on.
+   <h3>VERIFY TEXTS!!!</h3> You have receifed a mail, bafasel, please click link and so on.
 
 {/if}