* move some sv* into more modern templating
authorWilfried Göesgens <willi@citadel.org>
Sun, 29 Aug 2010 16:55:46 +0000 (16:55 +0000)
committerWilfried Göesgens <willi@citadel.org>
Sun, 29 Aug 2010 16:55:46 +0000 (16:55 +0000)
webcit/auth.c
webcit/static/t/openid_manual_create.html
webcit/static/t/room/edit/pop3client_removal.html

index 2dcfaf3bb8c64a1ca1d2a90e06a309a64baa2012..f6348dd48e482514c4034f9fa594d117e8b1de6f 100644 (file)
@@ -74,45 +74,6 @@ void display_openid_login(char *mesg)
 }
 
 
-void display_openid_name_request(const StrBuf *claimed_id, const StrBuf *username) 
-{
-       StrBuf *Buf = NULL;
-
-       output_headers(1, 1, 2, 0, 0, 0);
-       wc_printf("<div id=\"login_screen\">\n");
-
-       Buf = NewStrBufPlain(NULL, StrLength(claimed_id));
-       StrEscAppend(Buf, claimed_id, NULL, 0, 0);
-       svprintf(HKEY("VERIFIED"), WCS_STRING, _("Your OpenID <tt>%s</tt> was successfully verified."),
-                ChrPtr(Buf));
-       SVPutBuf("CLAIMED_ID", Buf, 0);
-
-
-       if (StrLength(username) > 0) {
-                       Buf = NewStrBufPlain(NULL, StrLength(username));
-                       StrEscAppend(Buf, username, NULL, 0, 0);
-                       svprintf(HKEY("REASON"), WCS_STRING,
-                                _("However, the user name '%s' conflicts with an existing user."), 
-                                ChrPtr(Buf));
-                       FreeStrBuf(&Buf);
-       }
-       else {
-               svput("REASON", WCS_STRING, "");
-       }
-
-       svput("ACTION_REQUESTED", WCS_STRING, _("Please specify the user name you would like to use."));
-
-       svput("USERNAME_BOX", WCS_STRING, _("User name:"));
-       svput("NEWUSER_BUTTON", WCS_STRING, _("New User"));
-       svput("EXIT_BUTTON", WCS_STRING, _("Exit"));
-
-       svprintf(HKEY("BOXTITLE"), WCS_STRING, _("%s - powered by <a href=\"http://www.citadel.org\">Citadel</a>"),
-                ChrPtr(WC->serv_info->serv_humannode));
-
-       do_template("openid_manual_create", NULL);
-       wDumpContent(2);
-}
-
 
 
 /* Initialize the session
@@ -307,7 +268,15 @@ void openid_manual_create(void)
                        do_welcome();
                }
        } else {
-               display_openid_name_request(sbstr("openid_url"), sbstr("name"));
+               const StrBuf *Buf;
+
+               putbstr("__claimed_id", NewStrBufDup(sbstr("openid_url")));
+               Buf = sbstr("name");
+               if (StrLength(Buf) > 0)
+                       putbstr("__username", NewStrBufDup(Buf));
+               begin_burst();
+               do_template("openid_manual_create", NULL);
+               end_burst();
        }
 
 }
@@ -447,11 +416,19 @@ void finalize_openid_login(void)
         */
 
        else if (!strcasecmp(ChrPtr(result), "verify_only")) {
-               display_openid_name_request(claimed_id, username);
+               putbstr("__claimed_id", claimed_id);
+               claimed_id = NULL;
+               if (StrLength(username) > 0) {
+                       putbstr("__username", username);
+                       username = NULL;
+               }
+               begin_burst();
+               do_template("openid_manual_create", NULL);
+               end_burst();
        }
 
        /* Did we manage to log in?  If so, continue with the normal flow... */
-       if (WC->logged_in) {
+       else if (WC->logged_in) {
                if (WC->need_regi) {
                        display_reg(1);
                } else {
index 170b80a0ce97dd1e94cf46496258f2510b125fa3..5577ef1ae4bfb932afa6c6bb5e253402ce6fa6c1 100644 (file)
@@ -1,18 +1,24 @@
-<?=("beginbox")>
+<?=("head")>
+<div id="login_screen">
+<?=("beginbox_1")>
+<?SERV:HUMANNODE><?_(" - powered by <a href='http://www.citadel.org'>Citadel</a>")>
+<?=("beginbox_2")>
 <?HELLO>
 <div class="login_infos">
-       <img src="static/openid-small.gif"><?VERIFIED><br />
-       <?REASON><br />
-       <?ACTION_REQUESTED><br />
+       <img src="static/openid-small.gif"><?_("Your OpenID")> <tt><?BSTR("__claimed_id", "X")></tt> <?_("was successfully verified.")><br />
+<??("COND:BSTR", 1, "__username")><?_("However, the user name")>  '<?BSTR("__claimed_id", "X")>' <?_("conflicts with an existing user.")<??("X", 1)>
+<br />
+       <?_("Please specify the user name you would like to use.")><br />
 </div>
 <form action="openid_manual_create" method="POST"  class="box" id="login_form">
-       <input type="hidden" NAME="openid_url" VALUE="<?CLAIMED_ID>">
-        <label for="uname"><?USERNAME_BOX></label>
+       <input type="hidden" NAME="openid_url" VALUE="<?BSTR("__claimed_id", "U")>">
+        <label for="uname"><?_("User name:")></label>
         <input type="text" name="name" id="uname" > <br>
         <div class="logbuttons">
-        <input type="submit" name="newuser_action" value="<?NEWUSER_BUTTON>" class="logbutton" >
-        <input type="submit" name="exit_action" value="<?EXIT_BUTTON>"  class="logbutton">
+        <input type="submit" name="newuser_action" value="<?_("New User")>" class="logbutton" >
+        <input type="submit" name="exit_action" value="<?_("Exit")>"  class="logbutton">
         <br>
         </div>
 </form>
 <?=("endbox")>
+<?=("trailing")>
index bc0d5cc109ea776e7eee08aea2940594ec2a7c24..d3c968aefd3336310a49bf0eb0204a9565d98c5a 100644 (file)
@@ -5,7 +5,7 @@
        <td><?CONTEXTSTRARR(#"GNET_POP3_DONT_DELETE_REMOTE")></td> <!-- Keep on server. didnt come up with a better name... -->
        <td><?CONTEXTSTRARR(#"GNET_POP3_INTERVAL")></td>
        <td class="button_link">
-               <a href="netedit?cmd=remove?tab=feeds?line=pop3client|<?CONTEXTSTRARR(#"POP3_HOST", "U")>">
+               <a href="netedit?cmd=remove?tab=feeds?line=pop3client|<?CONTEXTSTRARR(#"GNET_POP3_HOST", "U")>">
                        <?_("(remove)")>
                </a>
        </td>