plug_login.php 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <?php
  2. if (!class_exists("plug_login")) {
  3. class plug_login {
  4. function plug_login($ns) {
  5. $this->title = __("Login","dagsopt");
  6. $this->pluginname = $ns->pluginname;
  7. $this->file = $ns->file;
  8. $this->ns = $ns;
  9. }
  10. function start() {
  11. add_filter('login_headerurl',array(&$this,'login_headerurl'));
  12. add_filter('login_headertext',array(&$this,'login_headertitle'));
  13. add_filter('login_message',array(&$this,'login_message'));
  14. }
  15. function login_headerurl($t){ return "https://dags.dk/"; }
  16. function login_headertitle($t){ return "Dags dk"; }
  17. function login_message($t){
  18. return '<style type="text/css">
  19. .login h1 a {padding-bottom: 5px; width: auto; height: 65px; background-size: auto; background-image: url(/wp-content/plugins/dagsplug/login_logo.png);}
  20. .login_holder {margin: 0px 0px 20px 0px; text-align: center}
  21. </style>
  22. <div class="login_holder">
  23. <p>'.get_option($this->pluginname."_login_support_splash").'</p>
  24. </div>';
  25. }
  26. function help(){
  27. ?>
  28. <?php echo(__("Adds logo to login page","dagsopt")) ?>
  29. <a href="/wp-login.php"><?php echo(__("Login page","dagsopt")) ?></a>
  30. <?php
  31. }
  32. function Option($pre){
  33. update_option ( $pre.'_support_splash', $_POST [ $pre.'_support_splash' ] );
  34. }
  35. function admin_line($pre){
  36. ?>
  37. <?php echo(__("Login splash html:","dagsopt")) ?><br><textarea style="width: 100%; height: 150px;" name="<?php echo( $pre.'_support_splash' ); ?>"><?php echo(get_option($pre."_support_splash")); ?></textarea>
  38. <?php
  39. }
  40. }
  41. global $plug_login;
  42. $plug_login = new plug_login($this);
  43. $this->dagsopt['plug_login'] = $plug_login;
  44. }