Merge branch 'master' into sipb
[ikiwiki.git] / IkiWiki / CGI.pm
index 07369ac1076e748f8cd95e1aab5c2354a33877c8..d7c85ecb88c93b286cabe23ddb218c4f3fb48b68 100644 (file)
@@ -110,10 +110,14 @@ sub cgi_signin ($$) {
                template => {type => 'div'},
                stylesheet => baseurl()."style.css",
        );
-       my $buttons=["Login"];
-       
+       # MITLOGIN: These should be restored when logins are allowed again.
+       #my $buttons=["Login"];
+       my $buttons=[];
+
        if ($q->param("do") ne "signin" && !$form->submitted) {
-               $form->text(gettext("You need to log in first."));
+           #$form->text(gettext("You need to log in first."));
+               $form->text(
+                 "You must have an MIT personal certificate to edit");
        }
        $form->field(name => "do", type => "hidden", value => "signin",
                force => 1);
@@ -207,13 +211,16 @@ sub cgi_prefs ($$) {
                force => 1);
        $form->field(name => "sid", type => "hidden", value => $session->id,
                force => 1);
-       $form->field(name => "email", size => 50, fieldset => "preferences");
+            #$form->field(name => "email", size => 50, fieldset => "preferences");
+       $form->field(name => "realname", size => 50, fieldset => "preferences");
        
        my $user_name=$session->param("name");
 
        if (! $form->submitted) {
-               $form->field(name => "email", force => 1,
-                       value => userinfo_get($user_name, "email"));
+            #$form->field(name => "email", force => 1,
+            #value => userinfo_get($user_name, "email"));
+               $form->field(name => "realname", force => 1,
+                       value => userinfo_get($user_name, "realname"));
        }
        
        if ($form->submitted eq 'Logout') {
@@ -230,7 +237,10 @@ sub cgi_prefs ($$) {
                        userinfo_set($user_name, 'email', $form->field('email')) ||
                                error("failed to set email");
                }
-
+               if (defined $form->field('realname')) {
+                       userinfo_set($user_name, 'realname', $form->field('realname')) ||
+                               error("failed to set realname");
+                }
                $form->text(gettext("Preferences saved."));
        }