Changeset 1255
- Timestamp:
- 11/15/06 13:19:50 (2 years ago)
- Files:
-
- brains/blapi.php (modified) (2 diffs)
- brains/index.php (modified) (2 diffs)
- brains/login.php (modified) (3 diffs)
- brains/stylesheet.css (modified) (1 diff)
- brains/util.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
brains/blapi.php
r1254 r1255 11 11 } 12 12 13 function bounce_out( $m ) { 14 $m = urlencode( $m ); 15 ?> 16 <meta http-equiv="refresh" content="0; URL=/login?message=$m" /> 17 <?php 18 } 19 13 20 function authenticate( $u, $p ) { 14 $login_url = $this->domain . "/login?submission=credentials&login=$u&password=$p";21 $login_url = $this->domain . "/login?submission=credentials&login=$u&password=$p"; 15 22 $response = $this->xform( "transforms/authenticate.xsl", $login_url ); 16 23 $authid = $response[0]; 17 if( $authid && $authid != "INVALID:credentials" ) { 24 25 if( $authid && ! ( 26 stristr( $authid, "MANDATORY" ) 27 || stristr( $authid, "WRONGLENGTH" ) 28 || stristr( $authid, "UNICITY" ) 29 || stristr( $authid, "MANDATORY" ) 30 || stristr( $authid, "WRONGLENGTH" ) 31 || stristr( $authid, "INVALID" ) 32 ) 33 ) { 18 34 $this->authid = $authid; 19 35 setCookie( 'user', $u, time()+60*60*24*69, '/' ); … … 24 40 } else { 25 41 ?> 26 <meta http-equiv="refresh" content="0; URL=/login " />42 <meta http-equiv="refresh" content="0; URL=/login?message=Sorry,+we+were+not+able+to+log+you+in+with+that+user+and+password." /> 27 43 <?php 28 44 } brains/index.php
r1254 r1255 62 62 } else { 63 63 if( $show_html ) { 64 std_header(); 64 65 ?> 65 <html>66 <head>67 <title>68 brains.jm3.net69 </title>70 71 <script type="text/javascript" src="/brains.js"></script>72 <link rel="stylesheet" type="text/css" href="/stylesheet.css">73 74 </head>75 66 76 67 <body onLoad="focus_page();"> … … 90 81 </label> 91 82 </form> 92 93 <?php if( $REQUEST_URI != "/" ) { ?>94 <a href="/">View all my lists</a>95 <?php } ?>96 83 97 </body>98 </html>99 84 <?php 85 100 86 } 101 87 } brains/login.php
r1254 r1255 1 1 <?php 2 2 include( "blapi.php" ); 3 include( "util.php" ); 3 4 4 5 $bla = new Blapi(); … … 14 15 15 16 if( $show_html ) { 17 $message = $message ? $message : "Welcome, please log in:"; 18 std_header(); 16 19 ?> 17 20 21 <body> 22 18 23 <h2><a href="/">BRAINS</a></h2> 19 20 <?php if( ! $message ) { ?>21 <h3>Welcome, please log in:</h3>22 <?php } else { ?>23 24 <h3><?= $message ?></h3> 24 <?php } ?>25 25 26 26 <form name="login" action="/login" method="post"> 27 27 <label> 28 User name28 User: 29 29 <input name="user" value="<?= $user ?>" /> 30 30 </label> 31 31 <br /> 32 32 <label> 33 Password 33 Password: 34 34 <input type="password" name="password" /> 35 35 </label> … … 37 37 </form> 38 38 39 <? } ?> 39 <div class="note"> 40 Brains is powered by the magic of something called Blabla Lists.<br> 41 To use Brains, you only need to <a target="blank" href="http://blablalist.com/mylist?registerfirst=1">get a user name and password</a>. 42 </div> 43 44 45 <? 46 std_footer(); 47 48 } ?> brains/stylesheet.css
r1216 r1255 12 12 } 13 13 14 .note { 15 border: 1px solid white; 16 background-color: #ededed; 17 width: 30em; 18 padding: 1.0em; 19 margin: 0.5em; 20 } 21 22 #footer { 23 font-size: 80%; 24 } 25 14 26 /* liquid bag dots */ 15 27 .size-1 { background: url(/img/dots/1.gif) 0 3px no-repeat; } brains/util.php
r1211 r1255 1 <% 2 function page( $s ) { 3 %> 1 <?php 4 2 5 <%= $s %> 3 function std_header( $title = "brains.jm3.net" ) { 4 ?> 5 <html> 6 <head> 7 <title> <?= $title ?> </title> 8 <script type="text/javascript" src="/brains.js"></script> 9 <link rel="stylesheet" type="text/css" href="/stylesheet.css"> 10 </head> 11 <?php 12 } 6 13 7 <% 8 } 9 %> 14 function std_footer() { 15 ?> 16 17 <?php if( $_COOKIE["authid"] && $REQUEST_URI != "/" ) { ?> 18 <a href="/">View all my lists</a> 19 <?php } ?> 20 21 <div id="footer"> 22 Brains is a Codeswami / JM3, LLC creation 23 </div> 24 25 </body> 26 </html> 27 <?php 28 } 29 30 ?>