Guest User

flatnuke patch

a guest
May 7th, 2014
182
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. diff -Naur flatnuke/sections/none_Login/section.php flatnuke-patch/sections/none_Login/section.php
  2. --- flatnuke/sections/none_Login/section.php    2013-08-26 18:31:41.000000000 +0200
  3. +++ flatnuke-patch/sections/none_Login/section.php  2014-05-07 13:41:08.428312153 +0200
  4. @@ -778,7 +778,7 @@
  5.     }
  6.  
  7.     global $forumback,$forumborder;
  8. -   $nome=getparam("nome",PAR_POST,SAN_FLAT);
  9. +   $nome=getparam("regnome",PAR_POST,SAN_FLAT);
  10.     if(!is_alphanumeric($nome)) {
  11.         echo _FERRCAMPO."<br />";
  12.         echo "<a href=\"javascript:history.back()\">&lt;&lt;"._INDIETRO."</a>";
  13. @@ -1118,10 +1118,10 @@
  14.     }
  15.     function validate_reguser()
  16.         {
  17. -           if(document.getElementsByName('nome')[0].value=='')
  18. +           if(document.getElementsByName('regnome')[0].value=='')
  19.                 {
  20.                     alert('<?php echo _REQUIREDFIELD.": "._NOMEUTENTE?>');
  21. -                   document.getElementsByName('nome')[0].focus();
  22. +                   document.getElementsByName('regnome')[0].focus();
  23.                     document.getElementsByName('reregpass')[0].value='';
  24.                     return false;
  25.                 }
  26. @@ -1224,7 +1224,7 @@
  27.         else if ($action=="reguser"){
  28.         ?>
  29.         <tr><td>
  30. -       <label for="nome"><b><span>*</span>&nbsp;<?php echo _NOMEUTENTE?></b></label></td><td><input name="nome" type="text" id="nome" value="Username" onfocus="
  31. +       <label for="nome"><b><span>*</span>&nbsp;<?php echo _NOMEUTENTE?></b></label></td><td><input name="regnome" type="text" id="nome" value="Username" onfocus="
  32.     if (this.value=='Username'){this.value='';}"/></td></tr>
  33.     <tr><td><label for="regpass"><b><span>*</span>&nbsp;<?php echo _PASSWORD?></b></label></td><td><input name="regpass" type="password" id="regpass" /></td></tr>
  34.     <tr><td><label for="reregpass"><b><span>*</span>&nbsp;<?php echo _REPEATPASSWORD?></b></label></td><td> <input name="reregpass" type="password" id="reregpass" /></td>
  35. diff -Naur flatnuke/themes/fnluke/structure.php flatnuke-patch/themes/fnluke/structure.php
  36. --- flatnuke/themes/fnluke/structure.php    2013-11-30 20:02:43.000000000 +0100
  37. +++ flatnuke-patch/themes/fnluke/structure.php  2014-05-07 13:23:09.672294664 +0200
  38. @@ -38,6 +38,13 @@
  39.      <ul class="nav navbar-nav">
  40.        <?php create_menu_horiz(); ?>
  41.      </ul>
  42. +    
  43. +    <ul class="nav navbar-nav navbar-right">
  44. +      <li class="dropdown">
  45. +         <?php print_login(); ?>
  46. +      </li>
  47. +    </ul>
  48. +    
  49.      <form class="navbar-form navbar-right" role="search" method="post" action="index.php?mod=none_Search">
  50.        <div class="form-group">
  51.          <input name="find"   type="text"   class="form-control" placeholder="<?php echo _CERCA; ?>">
  52. diff -Naur flatnuke/themes/fnluke/theme.php flatnuke-patch/themes/fnluke/theme.php
  53. --- flatnuke/themes/fnluke/theme.php    2013-12-14 07:32:03.000000000 +0100
  54. +++ flatnuke-patch/themes/fnluke/theme.php  2014-05-07 13:20:22.556291955 +0200
  55. @@ -100,6 +100,187 @@
  56.     }
  57.  }
  58.  
  59. +function print_login(){
  60. +   if (preg_match("/login.php/i",$_SERVER['PHP_SELF'])) {
  61. +    Header("Location: ../../index.php");
  62. +    die();
  63. +}
  64. +
  65. +
  66. +// Security checks
  67. +$req = getparam("REQUEST_URI", PAR_SERVER, SAN_FLAT);
  68. +if(strstr($req,"myforum="))
  69. +   die(_NONPUOI);
  70. +  
  71. +        
  72. +
  73. +// user is not logged
  74. +if(_FN_IS_GUEST) {
  75. +   ?>
  76. +    <a href="#" id="drop-login" role="button" class="dropdown-toggle" data-toggle="dropdown">
  77. +              
  78. +    <span class="glyphicon glyphicon-user"> </span>Account<b class="caret"></b>
  79. +            </a>
  80. +          <ul class="dropdown-menu" role="menu" aria-labelledby="drop3">
  81. +              <li role="presentation">
  82. +              
  83. +              
  84. +
  85. +              
  86. +   <script type="text/javascript" language="javascript">
  87. +   function validatelogin()
  88. +       {
  89. +           if(document.getElementsByName('nome')[0].value=='')
  90. +               {
  91. +                   alert('<?php echo _REQUIREDFIELD.": "._NOMEUTENTE?>');
  92. +                   document.getElementsByName('nome')[0].focus();
  93. +                   document.getElementsByName('nome')[0].value='';
  94. +                   return false;
  95. +               }
  96. +           else if(document.getElementsByName('logpassword')[0].value=='')
  97. +               {
  98. +                   alert('<?php echo _REQUIREDFIELD.": "._PASSWORD?>');
  99. +                   document.getElementsByName('logpassword')[0].focus();
  100. +                   document.getElementsByName('logpassword')[0].value='';
  101. +                   return false;
  102. +               }
  103. +           else return true;
  104. +       }
  105. +   </script>
  106. +
  107. +   <form class="form-horizontal" role="form" action="index.php?mod=none_Login" method="post" onsubmit="return validatelogin()">
  108. +   <input type="hidden" name="action" value="login" />
  109. +   <input type="hidden" name="from" value="home" />
  110. +  <div class="form-group">
  111. +    <div class="col-sm-offset-1 col-sm-10">
  112. +      <input alt="username" name="nome" size="10" id="username" class="form-control" placeholder="Username">
  113. +    </div>
  114. +  </div>
  115. +  <div class="form-group">
  116. +    <div class="col-sm-offset-1 col-sm-10">
  117. +      <input  alt="password di accesso" name="logpassword" type="password" class="form-control" id="password" placeholder="Password">
  118. +    </div>
  119. +  </div>
  120. +  <div class="form-group">
  121. +    <div class="col-sm-offset-2 col-sm-10">
  122. +      <div class="checkbox">
  123. +        <label>
  124. +          <input type="checkbox" alt="ricorda l'accesso" name="rememberlogin" id="rememberlogin"> Ricorda
  125. +        </label>
  126. +      </div>
  127. +    </div>
  128. +  </div>
  129. +  <div class="form-group">
  130. +    <div class="col-sm-offset-3 col-sm-6">
  131. +      <button type="submit" class="btn btn-default">Entra</button>
  132. +    </div>
  133. +  </div>
  134. +</form>
  135. +
  136. +</li>
  137. +              <li role="presentation"><a href="index.php?mod=none_Login&amp;action=passwordlost" role="menuitem" tabindex="-1">Recupera password</a></li>
  138. +              <li role="presentation"><a href="index.php?mod=none_Login&action=visreg" role="menuitem" tabindex="-1">Registrati</a></li>
  139. +          </ul>
  140. +<?php
  141. +}
  142. +// user is logged
  143. +elseif(_FN_IS_USER OR _FN_IS_ADMIN) {
  144. +   // print user name
  145. +   $username = _FN_USERNAME;
  146. +    $img = _FN_USERAVATAR;
  147. +//    $level = _FN_USERLEVEL;
  148. +//   if(!file_exists("themes/$theme/images/level_y.gif") OR !file_exists("themes/$theme/images/level_n.gif")) {
  149. +//     $level_img_y = "images/useronline/level_y.gif";
  150. +//     $level_img_n = "images/useronline/level_n.gif";
  151. +//    } else {
  152. +//     $level_img_y = "themes/$theme/images/level_y.gif";
  153. +//     $level_img_n = "themes/$theme/images/level_n.gif";
  154. +// }
  155. +    ?>
  156. +    
  157. +    <a href="#" id="drop-login" role="button" class="dropdown-toggle" data-toggle="dropdown">
  158. +    
  159. +    <?php
  160. +       // print avatar
  161. +   if($img!="") {
  162. +       if(!stristr($img,"http://"))
  163. +           echo "<img src='forum/$img' class='img-rounded' style='width:20px;height:20px;' />";
  164. +       else echo "<img src='$img' class='img-rounded' style='width:20px;height:20px;' />";
  165. +   }
  166. +   else echo "<span class=\"glyphicon glyphicon-user\"></span>";
  167. +    ?>
  168. +              
  169. +      <?php echo $username;?><b class="caret"></b>
  170. +            </a>
  171. +          <ul class="dropdown-menu" role="menu" aria-labelledby="drop3">
  172. +           <li role="presentation"><a href="index.php?mod=none_Login&amp;action=viewprofile&amp;user=<?php echo $username;?>" role="menuitem" tabindex="-1">Visualizza profilo</a></li>
  173. +              
  174. +    <?php
  175. +  
  176. +    //print level
  177. +// print "<div style='position:relative;margin-left:0px;margin-right:0px;text-align:center;'><b>"._LEVEL." $level</b></div>";
  178. +// print "<div align='center'>";
  179. +// print "<hr size='1' noshade width='100%' />";
  180. +// for($i=0; $i<$level; $i++) {
  181. +//     print "<img src='$level_img_y' alt='level' />";
  182. +// }
  183. +// for($j=$i; $j<10; $j++) {
  184. +//     print "<img src='$level_img_n' alt='level' />";
  185. +// }
  186. +// print "<hr size='1' noshade width='100%' />";
  187. +// print "</div>";
  188. +   if (_FN_IS_NEWS_MODERATOR and !_FN_IS_ADMIN){
  189. +       global $home_section;
  190. +       if ($home_section==""){
  191. +           echo "<li role=\"presentation\"><a href=\"index.php?action=addnewsinterface\" role=\"menuitem\" tabindex=\"-1\">Aggiungi news</a></li>";
  192. +           }
  193. +           include_once("flatnews/include/news_functions.php");
  194. +       $proposednewsarray=load_proposed_news_list();
  195. +       if(count($proposednewsarray)>0) {
  196. +           $modstring="";
  197. +           if (_FN_MOD=="")
  198. +               $modstring = "mod=none_News&amp;";
  199. +           else $modstring = "mod="._FN_MOD."&amp;";
  200. +           ?>
  201. +            <li role="presentation"><a href="index.php?mod=none_News&amp;action=manageproposednews" role="menuitem" tabindex="-1">Notizie segnalate (<?php echo count($proposednewsarray)?>)</a></li>
  202. +           <?php
  203. +       }
  204. +   }
  205. +   // administrator panel
  206. +   if(_FN_IS_ADMIN) {
  207. +       ?>
  208. +        <li role="presentation"><a href="index.php?mod=none_Admin" role="menuitem" tabindex="-1">Amministra sito</a></li>
  209. +        <?php
  210. +       global $home_section;
  211. +       if ($home_section==""){
  212. +        echo "<li role=\"presentation\"><a href=\"index.php?action=addnewsinterface\" role=\"menuitem\" tabindex=\"-1\">Aggiungi news</a></li>";
  213. +       }
  214. +       include_once("flatnews/include/news_functions.php");
  215. +       $proposednewsarray=load_proposed_news_list();
  216. +       if(count($proposednewsarray)>0) {
  217. +           $modstring="";
  218. +           if (_FN_MOD=="")
  219. +               $modstring = "mod=none_News&amp;";
  220. +           else $modstring = "mod="._FN_MOD."&amp;";
  221. +           ?><li role="presentation"><a href="index.php?mod=none_News&amp;action=manageproposednews" role="menuitem" tabindex="-1">Notizie segnalate (<?php echo count($proposednewsarray)?>)</a></li>
  222. +           <?php
  223. +       }
  224. +        ?><li role="presentation"><a href="index.php?mod=fnnewsectinterface" role="menuitem" tabindex="-1">Crea sezione(home)</a></li>
  225. +       <?php
  226. +      
  227. +      
  228. +   }
  229. +   // logout
  230. +    ?>
  231. +    <li role="presentation"><a href="index.php?mod=none_Login&amp;action=logout&amp;from=home" role="menuitem" tabindex="-1">Esci</a></li>
  232. +    <?php
  233. +}else {echo "Cookie mismatch, please <a href='index.php?mod=none_Login&amp;action=logout&amp;from=home'>delete your cookies!</a>";}
  234. +
  235. +?>
  236. +</ul>
  237. +<?php
  238. +}
  239. +
  240.  // function to create footer site
  241.  function CreateFooterSite() {
  242.     $footer_elements = get_footer_array();
RAW Paste Data