cis notified web server of a job completion; upload form interface and validation...
[living-lab-site.git] / application / views / user / login_view.php
1 <?php echo form_open("user/login/$redirect") ?>
2 <fieldset>
3         <legend><?php echo sprintf($this->lang->line('user_legend_login_normal'), $this->config->item('site_name')) ?></legend>
4         
5         <table class="form">
6                 <tr>
7                         <th><?php echo $this->lang->line('user_username_or_email'). ': ' ?></th>
8                         <td>
9                                 <input type="text" name="username" size="16" value="<?php echo set_value('username') ?>" />
10                         </td>
11                 </tr>
12                 <tr>
13                         <td></td>
14                         <td><?php echo form_error('username') ?></td>
15                 </tr>
16                 <tr>
17                         <th><?php echo $this->lang->line('user_password'). ': ' ?></th>
18                         <td>
19                                 <input type="password" name="password" size="16" value="" />
20                         </td>
21                 </tr>
22                 <tr>
23                         <td></td>
24                         <td><?php echo form_error('password') ?></td>
25                 </tr>
26                 <tr>
27                         <td></td>
28                         <td>
29                                 <input type="submit" value="<?php echo $this->lang->line('ui_nav_menu_log_in') ?>" />
30                         </td>
31                 </tr>
32                 <tr>
33                         <td></td>
34                         <td>
35                                 <p><a href="<?php echo site_url('user/recover_password') ?>"><?php echo $this->lang->line('user_link_password_recovery') ?></a></p>
36                         </td>
37                 </tr>
38         </table>
39 </fieldset>
40 </form>
41
42 <?php echo form_open("user/login/$redirect") ?>
43 <fieldset>
44         <legend><?php echo $this->lang->line('user_legend_login_openid') ?></legend>
45         
46         <!--<p></p>-->
47         <p>
48                 <a class="login-openid" data-op="google" href="#">Google</a>
49                 <a class="login-openid" data-op="yahoo" href="#">Yahoo!</a>
50                 <a class="login-openid" data-op="myopenid" href="#">myOpenID</a>
51         </p>
52         
53         <table class="form">
54                 <tr>
55                         <th><?php echo $this->lang->line('user_openid'). ': ' ?></th>
56                         <td>
57                                 <input type="text" name="openid" size="64" value="<?php echo set_value('openid') ?>" />
58                         </td>
59                 </tr>
60                 <tr>
61                         <td></td>
62                         <td><?php echo form_error('openid') ?></td>
63                 </tr>
64                 
65                 <tr>
66                         <td></td>
67                         <td>
68                                 <input type="submit" value="<?php echo $this->lang->line('ui_nav_menu_log_in') ?>" />
69                         </td>
70                 </tr>
71         </table>
72 </fieldset>
73 </form>
74
75 <script type="text/javascript">
76         $(function() {
77                 $('.login-openid')
78                         .click(function() {
79                                 var op = $(this).data('op');
80                                 var openId;
81                                 
82                                 switch (op)
83                                 {
84                                 case 'google':
85                                         openId = 'https://www.google.com/accounts/o8/id';
86                                         break;
87                                 case 'yahoo':
88                                         openId = 'https://me.yahoo.com/';
89                                         break;
90                                 case 'myopenid':
91                                         openId = 'https://myopenid.com/';
92                                         break;
93                                 }
94                                 
95                                 $.post('<?php echo site_url('user/login') ?>',
96                                                 {'openid': openId},
97                                                 function(text) {
98                                                         document.open();
99                                                         document.write(text);
100                                                         document.close();
101                                                 });
102                         })
103                         .each(function() {
104                                 var op = $(this).data('op');
105                                 
106                                 $(this)
107                                         .button({
108                                                 icons: {
109                                                         primary: 'ui-icon-' + op
110                                                 }
111                                         });
112                         });
113                 
114         });
115 </script>