Advertisement
Guest User

RoundCube 0.6

a guest
Oct 25th, 2011
3,983
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.35 KB | None | 0 0
  1. External html login:
  2.  
  3. <form name='form' action="https://domain.com/index.php" method="post">
  4.   <p><label for="_user">Email</label><input name="_user" id="_user" value="" type="text" /></p>
  5.   <p><label for="_pass">Password</label><input name="_pass" id="_pass" value="" type="password" /></p>
  6.   <p>
  7.     <input type="hidden" name="autodetect" value="0" />
  8.     <input type="hidden" name="logged" value="1" />
  9.     <input type="hidden" name="_action" value="login" />
  10.     <input type="hidden" name="_task" value="login">
  11.     <input type="hidden" name="_timezone" value="_default_">
  12.     <input type="hidden" name="_url" value="">
  13.     <input class="button" name="submit" id="submit" value="Log on" type="submit" />
  14.   </p>
  15. </form>
  16.  
  17.  
  18. In config/main.inc.php:
  19.  
  20. $rcmail_config['plugins'] = array('password', 'http_authentication');
  21.  
  22.  
  23.  
  24.  
  25. In plugins/http_authentication/http_authentication.php:
  26.  
  27.   function authenticate($args)
  28.   {
  29.     // Allow entering other user data in login form,
  30.     // e.g. after log out (#1487953)
  31.     if (!empty($args['user'])) {
  32.         return $args;
  33.     }
  34.  
  35.     if (!empty($_SERVER['PHP_AUTH_USER']) && !empty($_SERVER['PHP_AUTH_PW'])) {
  36.       $args['user'] = $_SERVER['PHP_AUTH_USER'];
  37.       $args['pass'] = $_SERVER['PHP_AUTH_PW'];
  38.     }
  39.  
  40.     $args['cookiecheck'] = false;
  41.     $args['valid'] = true;
  42.  
  43.     return $args;
  44.   }
  45.  
  46.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement