Hallo Axel, Danke fü deine Antwort.
In php bin ich noch nicht so gut, deshalb sende ich mal die Datei
wo müsste ich was auschalten ?
in Zeile 93 steht return false;
PHP-Code:
<?php
/**
* @Copyright Copyright (C) 2010 Alfred Bösch
* @license GNU/GPL http://www.gnu.org/copyleft/gpl.html
**/
// no direct access
defined('_JEXEC') or die('Restricted access');
jimport('joomla.application.component.model');
class BoPasswordGenModelDefault extends JModel {
var $_data = null;
var $_opt1List = array(); // a-z
var $_opt2List = array(); // A-Z
var $_opt3List = array(); // 0-9
var $_opt4List = array(); // Sonderzeichen
function __construct() {
parent::__construct();
// a-z
for ($i=97; $i<=122; $i++) {
$this->_opt1List[] = chr($i);
}
// A-Z
for ($i=65; $i<=90; $i++) {
$this->_opt2List[] = chr($i);
}
// 0-9
for ($i=48; $i<=57; $i++) {
$this->_opt3List[] = chr($i);
}
// Sonderzeichen
for ($i=33; $i<=47; $i++) {
$this->_opt4List[] = chr($i);
}
for ($i=58; $i<=64; $i++) {
$this->_opt4List[] = chr($i);
}
for ($i=91; $i<=96; $i++) {
$this->_opt4List[] = chr($i);
}
for ($i=123; $i<=126; $i++) {
$this->_opt4List[] = chr($i);
}
}
function &getData() {
if (empty($this->_data)) {
$obj = new stdClass();
$task = JRequest::getVar('task', 0, 'post');
$opt1 = JRequest::getVar('opt1', 0, 'post');
$opt2 = JRequest::getVar('opt2', 0, 'post');
$opt3 = JRequest::getVar('opt3', 0, 'post');
$opt4 = JRequest::getVar('opt4', 0, 'post');
$length = JRequest::getVar('length', 8, 'post');
if ($length > 128 || $length < 0) {
$this->setError(JText::_('LENGTH OF THE STRING IS INVALID'));
$length = 0;
}
$mergedArrays = array();
$password = '';
if ($opt1) {
$mergedArrays = array_merge($this->_opt1List);
}
if ($opt2) {
$mergedArrays = array_merge($mergedArrays, $this->_opt2List);
}
if ($opt3) {
$mergedArrays = array_merge($mergedArrays, $this->_opt3List);
}
if ($opt4) {
$mergedArrays = array_merge($mergedArrays, $this->_opt4List);
}
if (!$task) {
return false;
} elseif (empty($mergedArrays)) {
$this->setError(JText::_('NO CHECKBOX SELECTED'));
} else {
for ($i=0; $i<$length; $i++) {
$rand_key = array_rand($mergedArrays, 1);
$password .= $mergedArrays[$rand_key];
}
}
$obj->error = $this->getError();
$obj->password = $password;
$this->_data = $obj;
}
return $this->_data;
}
}
Lesezeichen