Commit 64590e3e authored by dubwise's avatar dubwise
Browse files

Strong Passwords and BruteForce Attack Protection Mod

parent 9b95c52a
Loading
Loading
Loading
Loading
+45 −0
Original line number Diff line number Diff line
<?php
/*+***********************************************************************************************************************************
 * The contents of this file are subject to the YetiForce Public License Version 1.1 (the "License"); you may not use this file except
 * in compliance with the License.
 * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.
 * See the License for the specific language governing rights and limitations under the License.
 * The Original Code is YetiForce.
 * The Initial Developer of the Original Code is YetiForce. Portions created by YetiForce are Copyright (C) www.yetiforce.com. 
 * All Rights Reserved.
 *************************************************************************************************************************************/
$languageStrings = [
	'BruteForce'  => 'Brute Force',
    'Number of attempts' => 'Number of attemps',
    'Time lock' => 'Time lock (minutes)',
    'Settings' => 'Settings',
    'Blocked IP' => 'Blocked IP address',
    'BruteForce settings' => 'Brute Force settings',
    'Save' => 'Save',
    'LBL_SAVE_SUCCESS' => 'Changes have been saved',
    'LBL_FAIL' => 'Changes have not been saved',
    'LBL_UNBLOCK_FAIL' => 'IP adress has not been unblocked',
    'LBL_UNBLOCK_SUCCESS' => 'IP adress has been unblocked',
    'LBL_BRUTEFORCE_DESCRIPTION' => 'Set the maximum number of failed login attempts and time limit for IP blocking.',
    'Could not finnish reaction.' => 'Changes have not been saved',
    'IP' => 'IP address',
    'Date' => 'Date',
    'Users' => 'Users',
    'Browsers' => 'Browsers',
    'Unblock' => 'Unblock',
	'LBL_USERS_FOR_NOTIFICATIONS' => 'Users for notifications',
	'LBL_BRUTEFORCE_ACTIVE' => 'Active',
	'LBL_SAVE' => 'Save',
	'LBL_VIEW_SHOW' => 'Brute Force',
    
];
$jsLanguageStrings = [
    'Could not finnish reaction.' => 'Could not finnish this action.',
    'Complete the fields' => 'Complete the fields',
    'LBL_SAVE_SUCCESS' => 'Changes has been saved ',
    'LBL_FAIL' => 'Changes have not been saved', 
    'LBL_UNBLOCK_FAIL' => 'IP address has not been unblocked',
    'LBL_UNBLOCK_SUCCESS' => 'IP address has been unblocked',   
	'JS_WRONG_ATTEMPS_NUMBER' => 'You have entered an incorrect format for a number of attempts, correct it.',
	'JS_WRONG_TIME_LOCK_FORMAT' => 'You have entered an incorrect format for a time lock, correct it.'     
];
+25 −0
Original line number Diff line number Diff line
<?php
/*+***********************************************************************************************************************************
 * The contents of this file are subject to the YetiForce Public License Version 1.1 (the "License"); you may not use this file except
 * in compliance with the License.
 * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.
 * See the License for the specific language governing rights and limitations under the License.
 * The Original Code is YetiForce.
 * The Initial Developer of the Original Code is YetiForce. Portions created by YetiForce are Copyright (C) www.yetiforce.com. 
 * All Rights Reserved.
 * Contributor(s): 
 *************************************************************************************************************************************/
$languageStrings = [
	'Password' => 'Password Setup',
	'LBL_PASSWORD_DESCRIPTION' => 'Set complexities of the password for users of the software',
	'LBL_Password_Header' => 'Parameters determining the complexity of the password',
	'Minimum password length' => 'Minimum password length',
	'Maximum password length' => 'Maximum password length',
	'Uppercase letters from A to Z' => 'Uppercase letters from A to Z',
	'Lowercase letters a to z' => 'Lowercase letters a to z',
	'Password should contain numbers' => 'Password should contain numbers',
	'Password should contain special characters' => 'Password should contain special characters',
	'LBL_ERROR' => 'Error saving file',
	'LBL_SAVE_OK' => 'Data was saved',
	'characters' => 'characters',
];
+45 −0
Original line number Diff line number Diff line
<?php
/*+***********************************************************************************************************************************
 * The contents of this file are subject to the YetiForce Public License Version 1.1 (the "License"); you may not use this file except
 * in compliance with the License.
 * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.
 * See the License for the specific language governing rights and limitations under the License.
 * The Original Code is YetiForce.
 * The Initial Developer of the Original Code is YetiForce. Portions created by YetiForce are Copyright (C) www.yetiforce.com. 
 * All Rights Reserved.
 *************************************************************************************************************************************/
$languageStrings = [
	'BruteForce'  => 'Brute Force',
    'Number of attempts' => 'Nombre de tentatives',
    'Time lock' => 'Durée du blocage (minutes)',
    'Settings' => 'Réglages',
    'Blocked IP' => 'Adresses IP Bloquées',
    'BruteForce settings' => 'Réglages Brute Force',
    'Save' => 'Sauvegarder',
    'LBL_SAVE_SUCCESS' => 'Les modifications ont été prises en compte',
    'LBL_FAIL' => 'Les modifications n\'ont pas été enregistrées',
    'LBL_UNBLOCK_FAIL' => 'L\'adresse IP n\'a pas été débloquée',
    'LBL_UNBLOCK_SUCCESS' => 'L\'adresse IP a été débloquée',
    'LBL_BRUTEFORCE_DESCRIPTION' => 'Définir le nombre max. de tentatives d\'identification infructueuses et la durée du blocage des IP.',
    'Could not finnish reaction.' => 'Les modifications n\'ont pas été enregistrées',
    'IP' => 'Adresse IP',
    'Date' => 'Date',
    'Users' => 'Utilisateurs',
    'Browsers' => 'Navigateurs',
    'Unblock' => 'Débloquer',
	'LBL_USERS_FOR_NOTIFICATIONS' => 'Utilisateurs pour les notifications',
	'LBL_BRUTEFORCE_ACTIVE' => 'Actif',
	'LBL_SAVE' => 'Sauver',
	'LBL_VIEW_SHOW' => 'Brute Force',
    
];
$jsLanguageStrings = [
    'Could not finnish reaction.' => 'Impossible de terminer cette operation.',
    'Complete the fields' => 'Complétez les champs',
    'LBL_SAVE_SUCCESS' => 'Modifications sauvegardées ',
    'LBL_FAIL' => 'Modifications non sauvegardées', 
    'LBL_UNBLOCK_FAIL' => 'L\'adresse IP n\'a pas été débloquée',
    'LBL_UNBLOCK_SUCCESS' => 'L\'adresse IP a ete débloquée',   
	'JS_WRONG_ATTEMPS_NUMBER' => 'Format incorrect pour le nombre de tentatives, merci de bien vouloir corriger.',
	'JS_WRONG_TIME_LOCK_FORMAT' => 'Format incorrect pour la durée du blocage, merci de bien vouloir corriger.'     
];
 No newline at end of file
+25 −0
Original line number Diff line number Diff line
<?php
/*+***********************************************************************************************************************************
 * The contents of this file are subject to the YetiForce Public License Version 1.1 (the "License"); you may not use this file except
 * in compliance with the License.
 * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.
 * See the License for the specific language governing rights and limitations under the License.
 * The Original Code is YetiForce.
 * The Initial Developer of the Original Code is YetiForce. Portions created by YetiForce are Copyright (C) www.yetiforce.com. 
 * All Rights Reserved.
 * Contributor(s): 
 *************************************************************************************************************************************/
$languageStrings = [
	'Password' => 'Configuration des mots de passe',
	'LBL_PASSWORD_DESCRIPTION' => 'Définir le niveau de complexité des mots de passe du logiciel',
	'LBL_Password_Header' => 'Paramétres définissant le niveau de complexité des mots de passe',
	'Minimum password length' => 'Longeur minimum',
	'Maximum password length' => 'Logueur maximum',
	'Uppercase letters from A to Z' => 'Les mots de passe doivent contenir des lettres majuscules de A Ã  Z',
	'Lowercase letters a to z' => 'Les mots de passe doivent contenir des lettres minuscules de A Ã  Z',
	'Password should contain numbers' => 'Les mots de passe doivent contenir des nombres',
	'Password should contain special characters' => 'Les mots de passe doivent contenir des caractères spéciaux',
	'LBL_ERROR' => 'Sauvegarde impossible',
	'LBL_SAVE_OK' => 'Modifications enregistrées',
	'characters' => 'Caractères',
];
 No newline at end of file
+117 −0
Original line number Diff line number Diff line
{*
/*+***********************************************************************************************************************************
* The contents of this file are subject to the YetiForce Public License Version 1.1 (the "License"); you may not use this file except
* in compliance with the License.
* Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.
* See the License for the specific language governing rights and limitations under the License.
* The Original Code is YetiForce.
* The Initial Developer of the Original Code is YetiForce. Portions created by YetiForce are Copyright (C) www.yetiforce.com. 
* All Rights Reserved.
*************************************************************************************************************************************/
*}
<style>
	.brute_force_form td, label{
		text-align:center !important; 
		vertical-align:middle !important; 
		margin-bottom:0px !important;
	}
</style>
<div class="" style="margin-top:10px;">
	<h3>{vtranslate('BruteForce', $MODULE)}</h3>&nbsp;{vtranslate('LBL_BRUTEFORCE_DESCRIPTION', $MODULE)}<hr>
	<ul id="tabs" class="nav nav-tabs" data-tabs="tabs">
		<li class="active" id="brutalforce_tab_btn_1" ><a href="#tab_1">{vtranslate('Settings', $MODULE)}</a></li>
		<li  id="brutalforce_tab_btn_2" ><a href="#tab_2">{vtranslate('Blocked IP', $MODULE)}</a></li>
	</ul>
	<div id="my-tab-content" class="tab-content" >
		<div class='editViewContainer tab-panel' id="brutalforce_tab_1">
			<form id="brutalforce_tab_form_1" name="brutalforce_tab_1">
				<table class="table table-bordered table-condensed themeTableColor">
					<thead>
						<tr class="blockHeader">
							<th colspan="2" class="mediumWidthType">
								<span class="alignMiddle">{vtranslate('BruteForce settings', $MODULE)}</span>
							</th>
						</tr>
					</thead>
					<tbody>
						<tr>
							<td width="30%"><label class="muted pull-right marginRight10px">{vtranslate('Number of attempts', $MODULE)}</label></td>
							<td style="border-left: none;">
								<div class="col-md-2">
									<input type="text" class="form-control" name="attempsnumber" id="min_length" value="{$ATTEMPS_NUMBER}" />
								</div>
							</td>
						</tr>
						<tr>
							<td width="30%"><label class="muted pull-right marginRight10px">{vtranslate('Time lock', $MODULE)}</label></td>
							<td style="border-left: none;">
								<div class="col-md-2">
									<input type="text" class="form-control" name="timelock" id="min_length" value="{$BLOCK_TIME}" />
								</div>
							</td>
						</tr>
						<tr>
							<td width="30%"><label class="muted pull-right marginRight10px">{vtranslate('LBL_USERS_FOR_NOTIFICATIONS', $MODULE)}</label></td>
							<td style="border-left: none;">
								<div class="col-md-8">
									<select class="chzn-select" name="selectedUsers" multiple>
										{foreach key=KEY  item=USER from=$ADMINUSERS}
											<option value="{$KEY}" {if $USERFORNOTIFICATIONS } {if array_key_exists($KEY, $USERFORNOTIFICATIONS)}  selected {/if} {/if}>{$USER}</option>
										{/foreach}
									</select>
								</div>
							</td>
						</tr>
						<tr style="height:46px;">
							<td width="30%"><label class="muted pull-right marginRight10px">{vtranslate('LBL_BRUTEFORCE_ACTIVE', $MODULE)}</label></td>
							<td style="border-left: none;">
								<div class="col-md-3">
									<input type="checkbox" name="active" {if $BRUTEFORCEACTIVE} checked {/if} />
								</div>
							</td>
						</tr>
					</tbody>
				</table>
				<div class="pull-right" style="margin: 10px;">
					<button class="btn btn-success saveButton" type="submit" id='saveConfig' title="{vtranslate('LBL_SAVE', $MODULE)}"><strong>{vtranslate('LBL_SAVE', $MODULE)}</strong></button></div>
			</form>
		</div>
		<div class='editViewContainer tab-pane' id="brutalforce_tab_2" style="display:none;">
			<form id="brutalforce_tab_form_1" name="brutalforce_tab_2">
				<table class="table table-bordered table-condensed themeTableColor brute_force_form">
					<thead>
						<tr class="blockHeader">
							<th colspan="1" class="mediumWidthType">
								<span class="alignMiddle">{vtranslate('IP', $MODULE)}</span>
							</th>
							<th colspan="1" class="mediumWidthType">
								<span class="alignMiddle">{vtranslate('Date', $MODULE)}</span>
							</th>
							<th colspan="1" class="mediumWidthType">
								<span class="alignMiddle">{vtranslate('Users', $MODULE)}</span>
							</th>    
							<th colspan="1" class="mediumWidthType">
								<span class="alignMiddle">{vtranslate('Browsers', $MODULE)}</span>
							</th>     
							<th colspan="1" class="mediumWidthType">
								<span class="alignMiddle">{vtranslate('Unblock', $MODULE)}</span>
							</th>
						</tr>
					</thead>
					<tbody>					   
						{foreach from=$BLOCKED item=foo}
							<tr>
								<td width="23%"><label class="marginRight5px" >{$foo.ip}</label></td>
								<td width="23%"><label class="marginRight5px" >{$foo.date}</label></td>
								<td width="23%"><label class="marginRight5px" >{$foo.users}</label></td>
								<td width="23%"><label class="marginRight5px" >{$foo.browsers}</label></td>
								<td width="23%"><label class="marginRight5px" >
										<button data-ip="{$foo.ip}" class="btn btn-success" type="button" id='unblock' title="Zapisz"><strong>{vtranslate('Unblock', $MODULE)}</strong></button></label></td>
							</tr>
						{/foreach}
					</tbody>
				</table>
			</form>
		</div>  
	</div>
</div>
Loading