mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-20 00:12:15 +00:00
Merge branch 'master' into StatusabhaengigerDokumentenupload
This commit is contained in:
@@ -1,463 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
Copyright (c) 2002-2010, Michael Bretterklieber <michael@bretterklieber.com>
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
3. The names of the authors may not be used to endorse or promote products
|
||||
derived from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
|
||||
OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
||||
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
This code cannot simply be copied and put under the GNU Public License or
|
||||
any other GPL-like (LGPL, GPL2) License.
|
||||
|
||||
$Id: CHAP.php 302857 2010-08-28 21:12:59Z mbretter $
|
||||
*/
|
||||
|
||||
require_once 'PEAR.php';
|
||||
|
||||
/**
|
||||
* Classes for generating packets for various CHAP Protocols:
|
||||
* CHAP-MD5: RFC1994
|
||||
* MS-CHAPv1: RFC2433
|
||||
* MS-CHAPv2: RFC2759
|
||||
*
|
||||
* @package Crypt_CHAP
|
||||
* @author Michael Bretterklieber <michael@bretterklieber.com>
|
||||
* @access public
|
||||
* @version $Revision: 302857 $
|
||||
*/
|
||||
|
||||
/**
|
||||
* class Crypt_CHAP
|
||||
*
|
||||
* Abstract base class for CHAP
|
||||
*
|
||||
* @package Crypt_CHAP
|
||||
*/
|
||||
class Crypt_CHAP extends PEAR
|
||||
{
|
||||
/**
|
||||
* Random binary challenge
|
||||
* @var string
|
||||
*/
|
||||
var $challenge = null;
|
||||
|
||||
/**
|
||||
* Binary response
|
||||
* @var string
|
||||
*/
|
||||
var $response = null;
|
||||
|
||||
/**
|
||||
* User password
|
||||
* @var string
|
||||
*/
|
||||
var $password = null;
|
||||
|
||||
/**
|
||||
* Id of the authentication request. Should incremented after every request.
|
||||
* @var integer
|
||||
*/
|
||||
var $chapid = 1;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* Generates a random challenge
|
||||
* @return void
|
||||
*/
|
||||
function Crypt_CHAP()
|
||||
{
|
||||
$this->PEAR();
|
||||
$this->generateChallenge();
|
||||
}
|
||||
|
||||
/**
|
||||
* Generates a random binary challenge
|
||||
*
|
||||
* @param string $varname Name of the property
|
||||
* @param integer $size Size of the challenge in Bytes
|
||||
* @return void
|
||||
*/
|
||||
function generateChallenge($varname = 'challenge', $size = 8)
|
||||
{
|
||||
$this->$varname = '';
|
||||
for ($i = 0; $i < $size; $i++) {
|
||||
$this->$varname .= pack('C', 1 + mt_rand() % 255);
|
||||
}
|
||||
return $this->$varname;
|
||||
}
|
||||
|
||||
/**
|
||||
* Generates the response. Overwrite this.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function challengeResponse()
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* class Crypt_CHAP_MD5
|
||||
*
|
||||
* Generate CHAP-MD5 Packets
|
||||
*
|
||||
* @package Crypt_CHAP
|
||||
*/
|
||||
class Crypt_CHAP_MD5 extends Crypt_CHAP
|
||||
{
|
||||
|
||||
/**
|
||||
* Generates the response.
|
||||
*
|
||||
* CHAP-MD5 uses MD5-Hash for generating the response. The Hash consists
|
||||
* of the chapid, the plaintext password and the challenge.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function challengeResponse()
|
||||
{
|
||||
return pack('H*', md5(pack('C', $this->chapid) . $this->password . $this->challenge));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* class Crypt_CHAP_MSv1
|
||||
*
|
||||
* Generate MS-CHAPv1 Packets. MS-CHAP doesen't use the plaintext password, it uses the
|
||||
* NT-HASH wich is stored in the SAM-Database or in the smbpasswd, if you are using samba.
|
||||
* The NT-HASH is MD4(str2unicode(plaintextpass)).
|
||||
* You need the hash extension for this class.
|
||||
*
|
||||
* @package Crypt_CHAP
|
||||
*/
|
||||
class Crypt_CHAP_MSv1 extends Crypt_CHAP
|
||||
{
|
||||
/**
|
||||
* Wether using deprecated LM-Responses or not.
|
||||
* 0 = use LM-Response, 1 = use NT-Response
|
||||
* @var bool
|
||||
*/
|
||||
var $flags = 1;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* Loads the hash extension
|
||||
* @return void
|
||||
*/
|
||||
function Crypt_CHAP_MSv1()
|
||||
{
|
||||
$this->Crypt_CHAP();
|
||||
$this->loadExtension('hash');
|
||||
}
|
||||
|
||||
/**
|
||||
* Generates the NT-HASH from the given plaintext password.
|
||||
*
|
||||
* @access public
|
||||
* @return string
|
||||
*/
|
||||
function ntPasswordHash($password = null)
|
||||
{
|
||||
if (isset($password)) {
|
||||
return pack('H*',hash('md4', $this->str2unicode($password)));
|
||||
} else {
|
||||
return pack('H*',hash('md4', $this->str2unicode($this->password)));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts ascii to unicode.
|
||||
*
|
||||
* @access public
|
||||
* @return string
|
||||
*/
|
||||
function str2unicode($str)
|
||||
{
|
||||
$uni = '';
|
||||
$str = (string) $str;
|
||||
for ($i = 0; $i < strlen($str); $i++) {
|
||||
$a = ord($str{$i}) << 8;
|
||||
$uni .= sprintf("%X", $a);
|
||||
}
|
||||
return pack('H*', $uni);
|
||||
}
|
||||
|
||||
/**
|
||||
* Generates the NT-Response.
|
||||
*
|
||||
* @access public
|
||||
* @return string
|
||||
*/
|
||||
function challengeResponse()
|
||||
{
|
||||
return $this->_challengeResponse();
|
||||
}
|
||||
|
||||
/**
|
||||
* Generates the NT-Response.
|
||||
*
|
||||
* @access public
|
||||
* @return string
|
||||
*/
|
||||
function ntChallengeResponse()
|
||||
{
|
||||
return $this->_challengeResponse(false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Generates the LAN-Manager-Response.
|
||||
*
|
||||
* @access public
|
||||
* @return string
|
||||
*/
|
||||
function lmChallengeResponse()
|
||||
{
|
||||
return $this->_challengeResponse(true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Generates the response.
|
||||
*
|
||||
* Generates the response using DES.
|
||||
*
|
||||
* @param bool $lm wether generating LAN-Manager-Response
|
||||
* @access private
|
||||
* @return string
|
||||
*/
|
||||
function _challengeResponse($lm = false)
|
||||
{
|
||||
if ($lm) {
|
||||
$hash = $this->lmPasswordHash();
|
||||
} else {
|
||||
$hash = $this->ntPasswordHash();
|
||||
}
|
||||
|
||||
while (strlen($hash) < 21) {
|
||||
$hash .= "\0";
|
||||
}
|
||||
|
||||
$td = mcrypt_module_open(MCRYPT_DES, '', MCRYPT_MODE_ECB, '');
|
||||
$iv = mcrypt_create_iv (mcrypt_enc_get_iv_size($td), MCRYPT_RAND);
|
||||
$key = $this->_desAddParity(substr($hash, 0, 7));
|
||||
mcrypt_generic_init($td, $key, $iv);
|
||||
$resp1 = mcrypt_generic($td, $this->challenge);
|
||||
mcrypt_generic_deinit($td);
|
||||
|
||||
$key = $this->_desAddParity(substr($hash, 7, 7));
|
||||
mcrypt_generic_init($td, $key, $iv);
|
||||
$resp2 = mcrypt_generic($td, $this->challenge);
|
||||
mcrypt_generic_deinit($td);
|
||||
|
||||
$key = $this->_desAddParity(substr($hash, 14, 7));
|
||||
mcrypt_generic_init($td, $key, $iv);
|
||||
$resp3 = mcrypt_generic($td, $this->challenge);
|
||||
mcrypt_generic_deinit($td);
|
||||
mcrypt_module_close($td);
|
||||
|
||||
return $resp1 . $resp2 . $resp3;
|
||||
}
|
||||
|
||||
/**
|
||||
* Generates the LAN-Manager-HASH from the given plaintext password.
|
||||
*
|
||||
* @access public
|
||||
* @return string
|
||||
*/
|
||||
function lmPasswordHash($password = null)
|
||||
{
|
||||
$plain = isset($password) ? $password : $this->password;
|
||||
|
||||
$plain = substr(strtoupper($plain), 0, 14);
|
||||
while (strlen($plain) < 14) {
|
||||
$plain .= "\0";
|
||||
}
|
||||
|
||||
return $this->_desHash(substr($plain, 0, 7)) . $this->_desHash(substr($plain, 7, 7));
|
||||
}
|
||||
|
||||
/**
|
||||
* Generates an irreversible HASH.
|
||||
*
|
||||
* @access private
|
||||
* @return string
|
||||
*/
|
||||
function _desHash($plain)
|
||||
{
|
||||
$key = $this->_desAddParity($plain);
|
||||
$td = mcrypt_module_open(MCRYPT_DES, '', MCRYPT_MODE_ECB, '');
|
||||
$iv = mcrypt_create_iv (mcrypt_enc_get_iv_size($td), MCRYPT_RAND);
|
||||
mcrypt_generic_init($td, $key, $iv);
|
||||
$hash = mcrypt_generic($td, 'KGS!@#$%');
|
||||
mcrypt_generic_deinit($td);
|
||||
mcrypt_module_close($td);
|
||||
return $hash;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds the parity bit to the given DES key.
|
||||
*
|
||||
* @access private
|
||||
* @param string $key 7-Bytes Key without parity
|
||||
* @return string
|
||||
*/
|
||||
function _desAddParity($key)
|
||||
{
|
||||
static $odd_parity = array(
|
||||
1, 1, 2, 2, 4, 4, 7, 7, 8, 8, 11, 11, 13, 13, 14, 14,
|
||||
16, 16, 19, 19, 21, 21, 22, 22, 25, 25, 26, 26, 28, 28, 31, 31,
|
||||
32, 32, 35, 35, 37, 37, 38, 38, 41, 41, 42, 42, 44, 44, 47, 47,
|
||||
49, 49, 50, 50, 52, 52, 55, 55, 56, 56, 59, 59, 61, 61, 62, 62,
|
||||
64, 64, 67, 67, 69, 69, 70, 70, 73, 73, 74, 74, 76, 76, 79, 79,
|
||||
81, 81, 82, 82, 84, 84, 87, 87, 88, 88, 91, 91, 93, 93, 94, 94,
|
||||
97, 97, 98, 98,100,100,103,103,104,104,107,107,109,109,110,110,
|
||||
112,112,115,115,117,117,118,118,121,121,122,122,124,124,127,127,
|
||||
128,128,131,131,133,133,134,134,137,137,138,138,140,140,143,143,
|
||||
145,145,146,146,148,148,151,151,152,152,155,155,157,157,158,158,
|
||||
161,161,162,162,164,164,167,167,168,168,171,171,173,173,174,174,
|
||||
176,176,179,179,181,181,182,182,185,185,186,186,188,188,191,191,
|
||||
193,193,194,194,196,196,199,199,200,200,203,203,205,205,206,206,
|
||||
208,208,211,211,213,213,214,214,217,217,218,218,220,220,223,223,
|
||||
224,224,227,227,229,229,230,230,233,233,234,234,236,236,239,239,
|
||||
241,241,242,242,244,244,247,247,248,248,251,251,253,253,254,254);
|
||||
|
||||
$bin = '';
|
||||
for ($i = 0; $i < strlen($key); $i++) {
|
||||
$bin .= sprintf('%08s', decbin(ord($key{$i})));
|
||||
}
|
||||
|
||||
$str1 = explode('-', substr(chunk_split($bin, 7, '-'), 0, -1));
|
||||
$x = '';
|
||||
foreach($str1 as $s) {
|
||||
$x .= sprintf('%02s', dechex($odd_parity[bindec($s . '0')]));
|
||||
}
|
||||
|
||||
return pack('H*', $x);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Generates the response-packet.
|
||||
*
|
||||
* @param bool $lm wether including LAN-Manager-Response
|
||||
* @access private
|
||||
* @return string
|
||||
*/
|
||||
function response($lm = false)
|
||||
{
|
||||
$ntresp = $this->ntChallengeResponse();
|
||||
if ($lm) {
|
||||
$lmresp = $this->lmChallengeResponse();
|
||||
} else {
|
||||
$lmresp = str_repeat ("\0", 24);
|
||||
}
|
||||
|
||||
// Response: LM Response, NT Response, flags (0 = use LM Response, 1 = use NT Response)
|
||||
return $lmresp . $ntresp . pack('C', !$lm);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* class Crypt_CHAP_MSv2
|
||||
*
|
||||
* Generate MS-CHAPv2 Packets. This version of MS-CHAP uses a 16 Bytes authenticator
|
||||
* challenge and a 16 Bytes peer Challenge. LAN-Manager responses no longer exists
|
||||
* in this version. The challenge is already a SHA1 challenge hash of both challenges
|
||||
* and of the username.
|
||||
*
|
||||
* @package Crypt_CHAP
|
||||
*/
|
||||
class Crypt_CHAP_MSv2 extends Crypt_CHAP_MSv1
|
||||
{
|
||||
/**
|
||||
* The username
|
||||
* @var string
|
||||
*/
|
||||
var $username = null;
|
||||
|
||||
/**
|
||||
* The 16 Bytes random binary peer challenge
|
||||
* @var string
|
||||
*/
|
||||
var $peerChallenge = null;
|
||||
|
||||
/**
|
||||
* The 16 Bytes random binary authenticator challenge
|
||||
* @var string
|
||||
*/
|
||||
var $authChallenge = null;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* Generates the 16 Bytes peer and authentication challenge
|
||||
* @return void
|
||||
*/
|
||||
function Crypt_CHAP_MSv2()
|
||||
{
|
||||
$this->Crypt_CHAP_MSv1();
|
||||
$this->generateChallenge('peerChallenge', 16);
|
||||
$this->generateChallenge('authChallenge', 16);
|
||||
}
|
||||
|
||||
/**
|
||||
* Generates a hash from the NT-HASH.
|
||||
*
|
||||
* @access public
|
||||
* @param string $nthash The NT-HASH
|
||||
* @return string
|
||||
*/
|
||||
function ntPasswordHashHash($nthash)
|
||||
{
|
||||
return pack('H*',hash('md4', $nthash));
|
||||
}
|
||||
|
||||
/**
|
||||
* Generates the challenge hash from the peer and the authenticator challenge and
|
||||
* the username. SHA1 is used for this, but only the first 8 Bytes are used.
|
||||
*
|
||||
* @access public
|
||||
* @return string
|
||||
*/
|
||||
function challengeHash()
|
||||
{
|
||||
return substr(pack('H*',hash('sha1', $this->peerChallenge . $this->authChallenge . $this->username)), 0, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* Generates the response.
|
||||
*
|
||||
* @access public
|
||||
* @return string
|
||||
*/
|
||||
function challengeResponse()
|
||||
{
|
||||
$this->challenge = $this->challengeHash();
|
||||
return $this->_challengeResponse();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
@@ -1,119 +0,0 @@
|
||||
--TEST--
|
||||
Crypt_CHAP: simple test
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded("hash")) echo 'skip'; ?>
|
||||
--FILE--
|
||||
<?php
|
||||
/*
|
||||
Copyright (c) 2003-2007, Michael Bretterklieber <michael@bretterklieber.com>
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
3. The names of the authors may not be used to endorse or promote products
|
||||
derived from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
|
||||
OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
||||
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
This code cannot simply be copied and put under the GNU Public License or
|
||||
any other GPL-like (LGPL, GPL2) License.
|
||||
|
||||
$Id: chaptest.php 231819 2007-03-14 07:39:07Z mbretter $
|
||||
*/
|
||||
chdir (dirname(__FILE__));
|
||||
if (file_exists('../CHAP.php')) {
|
||||
require_once '../CHAP.php';
|
||||
} else {
|
||||
require_once 'Crypt/CHAP.php';
|
||||
}
|
||||
|
||||
echo "CHAP-MD5 TEST\n";
|
||||
$crpt = new Crypt_CHAP_MD5;
|
||||
$crpt->password = 'MyPw';
|
||||
$crpt->chapid = 1;
|
||||
$crpt->challenge = pack('H*', '102DB5DF085D3041');
|
||||
printf ("ChallResp : %s\n", bin2hex($crpt->challengeResponse()));
|
||||
echo "\n";
|
||||
|
||||
echo "CHAP-MD5 TEST 2\n";
|
||||
$crpt = new Crypt_CHAP_MD5;
|
||||
$crpt->password = 'sepp';
|
||||
$crpt->chapid = 1;
|
||||
$crpt->challenge = pack('H*', '102DB5DF085D3041');
|
||||
printf ("ChallResp : %s\n", bin2hex($crpt->challengeResponse()));
|
||||
echo "\n";
|
||||
|
||||
echo "MS-CHAPv1 str2unicode\n";
|
||||
$crpt = new Crypt_CHAP_MSv1;
|
||||
printf("Passed 123 as Number:%s\n", bin2hex($crpt->str2unicode(123)));
|
||||
printf("Passed 123 as String:%s\n", bin2hex($crpt->str2unicode('123')));
|
||||
echo "\n";
|
||||
|
||||
echo "MS-CHAPv1 TEST\n";
|
||||
$crpt->password = 'MyPw';
|
||||
$crpt->challenge = pack('H*', '102DB5DF085D3041');
|
||||
$unipw = $crpt->str2unicode($crpt->password);
|
||||
printf ("Unicode PW: %s\n", bin2hex($unipw));
|
||||
printf ("NT HASH : %s\n", bin2hex($crpt->ntPasswordHash()));
|
||||
printf ("NT Resp : %s\n", bin2hex($crpt->challengeResponse()));
|
||||
printf ("LM HASH : %s\n", bin2hex($crpt->lmPasswordHash()));
|
||||
printf ("LM Resp : %s\n", bin2hex($crpt->lmChallengeResponse()));
|
||||
//printf ("Response : %s\nexpected : unknown\n", bin2hex($crpt->response()));
|
||||
echo "\n";
|
||||
|
||||
echo "MS-CHAPv2 TEST\n";
|
||||
$crpt = new Crypt_CHAP_MSv2;
|
||||
$crpt->username = 'User';
|
||||
$crpt->password = 'clientPass';
|
||||
printf ("Username : %s\n", bin2hex($crpt->username));
|
||||
$crpt->authChallenge = pack('H*', '5b5d7c7d7b3f2f3e3c2c602132262628');
|
||||
$crpt->peerChallenge = pack('H*', '21402324255E262A28295F2B3A337C7E');
|
||||
$nthash = $crpt->ntPasswordHash();
|
||||
printf ("NT HASH : %s\n", bin2hex($nthash));
|
||||
$nthashhash = $crpt->ntPasswordHashHash($nthash);
|
||||
printf ("NT HASH-HASH : %s\n", bin2hex($nthashhash));
|
||||
printf ("ChallResp : %s\n", bin2hex($crpt->challengeResponse()));
|
||||
printf ("Challenge : %s\n", bin2hex($crpt->challenge));
|
||||
echo "\n";
|
||||
?>
|
||||
--EXPECT--
|
||||
CHAP-MD5 TEST
|
||||
ChallResp : 8f028814450d66d94c72331ef455a172
|
||||
|
||||
CHAP-MD5 TEST 2
|
||||
ChallResp : d39bfaf5d6855a948c8c81a85947502c
|
||||
|
||||
MS-CHAPv1 str2unicode
|
||||
Passed 123 as Number:310032003300
|
||||
Passed 123 as String:310032003300
|
||||
|
||||
MS-CHAPv1 TEST
|
||||
Unicode PW: 4d00790050007700
|
||||
NT HASH : fc156af7edcd6c0edde3337d427f4eac
|
||||
NT Resp : 4e9d3c8f9cfd385d5bf4d3246791956ca4c351ab409a3d61
|
||||
LM HASH : 75ba30198e6d1975aad3b435b51404ee
|
||||
LM Resp : 91881d0152ab0c33c524135ec24a95ee64e23cdc2d33347d
|
||||
|
||||
MS-CHAPv2 TEST
|
||||
Username : 55736572
|
||||
NT HASH : 44ebba8d5312b8d611474411f56989ae
|
||||
NT HASH-HASH : 41c00c584bd2d91c4017a2a12fa59f3f
|
||||
ChallResp : 82309ecd8d708b5ea08faa3981cd83544233114a3d85d6df
|
||||
Challenge : d02e4386bce91226
|
||||
|
||||
+15
-7
@@ -301,7 +301,7 @@ class akte extends basis_db
|
||||
* @param string $order Sortierreihenfolge im SQL
|
||||
* @return true wenn ok, sonst false
|
||||
*/
|
||||
public function getAkten($person_id, $dokument_kurzbz=null, $stg_kz = null, $prestudent_id = null, $returnInhalt = false, $order = 'erstelltam')
|
||||
public function getAkten($person_id, $dokument_kurzbz = null, $stg_kz = null, $prestudent_id = null, $returnInhalt = false, $order = 'erstelltam')
|
||||
{
|
||||
$qry = "SELECT
|
||||
akte_id, person_id, dokument_kurzbz, mimetype, erstelltam, gedruckt, titel_intern, anmerkung_intern,
|
||||
@@ -309,20 +309,28 @@ class akte extends basis_db
|
||||
CASE WHEN inhalt is not null THEN true ELSE false END as inhalt_vorhanden,
|
||||
nachgereicht_am, ausstellungsnation, formal_geprueft_amum, archiv, signiert, stud_selfservice";
|
||||
if($returnInhalt === true)
|
||||
$qry.=",inhalt ";
|
||||
{
|
||||
$qry .= ",inhalt ";
|
||||
}
|
||||
|
||||
$qry.=" FROM public.tbl_akte WHERE person_id=".$this->db_add_param($person_id, FHC_INTEGER);
|
||||
if($dokument_kurzbz!=null)
|
||||
$qry.=" AND dokument_kurzbz=".$this->db_add_param($dokument_kurzbz);
|
||||
if($dokument_kurzbz != '')
|
||||
{
|
||||
$qry .= " AND dokument_kurzbz=".$this->db_add_param($dokument_kurzbz);
|
||||
}
|
||||
if($stg_kz != null && $prestudent_id != null)
|
||||
$qry.=" AND dokument_kurzbz not in (SELECT dokument_kurzbz FROM public.tbl_dokument JOIN public.tbl_dokumentstudiengang USING(dokument_kurzbz)
|
||||
{
|
||||
$qry .= " AND dokument_kurzbz not in (SELECT dokument_kurzbz FROM public.tbl_dokument JOIN public.tbl_dokumentstudiengang USING(dokument_kurzbz)
|
||||
WHERE studiengang_kz= ".$this->db_add_param($stg_kz).") AND dokument_kurzbz NOT IN ('Zeugnis','DiplSupp','Bescheid') AND dokument_kurzbz NOT IN
|
||||
(SELECT dokument_kurzbz FROM public.tbl_dokumentprestudent JOIN public.tbl_dokument USING(dokument_kurzbz)
|
||||
WHERE prestudent_id=".$this->db_add_param($prestudent_id).")";
|
||||
}
|
||||
|
||||
if ($order != '')
|
||||
$qry.=" ORDER BY ".$order;
|
||||
|
||||
{
|
||||
$qry .= " ORDER BY ".$order;
|
||||
}
|
||||
//echo $qry;
|
||||
$this->errormsg = $qry;
|
||||
|
||||
if($this->db_query($qry))
|
||||
|
||||
@@ -694,7 +694,7 @@ class dokument extends basis_db
|
||||
$bezeichnung_mehrsprachig = $sprache->getSprachQuery('bezeichnung_mehrsprachig');
|
||||
$dokumentbeschreibung_mehrsprachig = $sprache->getSprachQuery('dokumentbeschreibung_mehrsprachig');
|
||||
$beschreibung_mehrsprachig = $sprache->getSprachQuery('beschreibung_mehrsprachig');
|
||||
$qry = "SELECT distinct on (dokument_kurzbz) dokument_kurzbz, bezeichnung, pflicht, nachreichbar, ausstellungsdetails,
|
||||
$qry = "SELECT distinct on (dokument_kurzbz) dokument_kurzbz, bezeichnung, pflicht, nachreichbar, ausstellungsdetails, stufe,
|
||||
$bezeichnung_mehrsprachig, $dokumentbeschreibung_mehrsprachig, $beschreibung_mehrsprachig
|
||||
FROM public.tbl_dokumentstudiengang
|
||||
JOIN public.tbl_prestudent using (studiengang_kz)
|
||||
|
||||
@@ -855,11 +855,17 @@ function encryptData($value,$key)
|
||||
return false;
|
||||
}
|
||||
|
||||
$text = $value;
|
||||
$iv_size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB);
|
||||
$iv = mcrypt_create_iv($iv_size, MCRYPT_RAND);
|
||||
$crypttext = mcrypt_encrypt(MCRYPT_RIJNDAEL_256, $key, $text, MCRYPT_MODE_ECB, $iv);
|
||||
return trim(safe_b64encode($crypttext));
|
||||
require_once(dirname(__FILE__)."/../vendor/autoload.php");
|
||||
|
||||
$cipher = new phpseclib\Crypt\Rijndael(phpseclib\Crypt\Rijndael::MODE_ECB);
|
||||
$cipher->setKey($key);
|
||||
$cipher->disablePadding();
|
||||
$length = strlen($value);
|
||||
$pad = 32 - ($length % 32);
|
||||
$value = str_pad($value, $length + $pad, chr(0));
|
||||
$cipher->setBlockLength(256);
|
||||
|
||||
return trim(safe_b64encode($cipher->encrypt($value)));
|
||||
}
|
||||
|
||||
function decryptData($value,$key)
|
||||
@@ -869,11 +875,14 @@ function decryptData($value,$key)
|
||||
return false;
|
||||
}
|
||||
|
||||
require_once(dirname(__FILE__)."/../vendor/autoload.php");
|
||||
$crypttext = safe_b64decode($value);
|
||||
$iv_size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB);
|
||||
$iv = mcrypt_create_iv($iv_size, MCRYPT_RAND);
|
||||
$decrypttext = mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $key, $crypttext, MCRYPT_MODE_ECB, $iv);
|
||||
return trim($decrypttext);
|
||||
$cipher = new phpseclib\Crypt\Rijndael(phpseclib\Crypt\Rijndael::MODE_ECB);
|
||||
$cipher->disablePadding();
|
||||
$cipher->setBlockLength(256);
|
||||
$cipher->setKey($key);
|
||||
|
||||
return trim($cipher->decrypt($crypttext));
|
||||
}
|
||||
|
||||
function clearHtmlTags($text)
|
||||
|
||||
@@ -825,5 +825,68 @@ class gebiet extends basis_db
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Prueft, ob das Gebiet zumindest eine Frage oder einen Vorschlag im MathML Format hat.
|
||||
* @param $gebiet_id
|
||||
* return true, wenn Gebiet eine/n Frage/Vorschlag im MathML Format enthält.
|
||||
*/
|
||||
public function hasMathML($gebiet_id)
|
||||
{
|
||||
if (is_numeric($gebiet_id))
|
||||
{
|
||||
$qry = '
|
||||
WITH
|
||||
fragen AS (
|
||||
SELECT DISTINCT
|
||||
frage_id
|
||||
FROM
|
||||
testtool.tbl_frage
|
||||
JOIN
|
||||
testtool.tbl_gebiet USING (gebiet_id)
|
||||
WHERE
|
||||
tbl_gebiet.gebiet_id = '. $this->db_add_param($gebiet_id, FHC_INTEGER). '
|
||||
),
|
||||
vorschlaege AS (
|
||||
SELECT DISTINCT
|
||||
vorschlag_id
|
||||
FROM
|
||||
testtool.tbl_vorschlag
|
||||
JOIN
|
||||
fragen USING (frage_id)
|
||||
)
|
||||
|
||||
SELECT
|
||||
1
|
||||
FROM
|
||||
testtool.tbl_frage_sprache
|
||||
JOIN
|
||||
fragen USING (frage_id)
|
||||
WHERE
|
||||
SUBSTRING(text, \'MathML\') IS NOT NULL
|
||||
|
||||
UNION
|
||||
|
||||
SELECT
|
||||
1
|
||||
FROM
|
||||
testtool.tbl_vorschlag_sprache
|
||||
JOIN
|
||||
vorschlaege USING (vorschlag_id)
|
||||
WHERE
|
||||
SUBSTRING(text, \'MathML\') IS NOT NULL
|
||||
';
|
||||
|
||||
if($result = $this->db_query($qry))
|
||||
{
|
||||
return ($this->db_num_rows($result) > 0);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->errormsg = 'Eine numerische gebiet_id muss übergeben werden.';
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
@@ -279,9 +279,14 @@ class kontakt extends basis_db
|
||||
return false;
|
||||
}
|
||||
|
||||
$qry = "SELECT tbl_kontakt.*, tbl_firma.name as firma_name, tbl_firma.firma_id
|
||||
FROM public.tbl_kontakt LEFT JOIN public.tbl_standort USING(standort_id) LEFT JOIN public.tbl_firma USING(firma_id) WHERE person_id=".$this->db_add_param($person_id, FHC_INTEGER)."
|
||||
AND kontakttyp =".$this->db_add_param($kontakttyp, FHC_STRING);
|
||||
$qry = "SELECT tbl_kontakt.*,
|
||||
tbl_firma.NAME AS firma_name,
|
||||
tbl_firma.firma_id
|
||||
FROM PUBLIC.tbl_kontakt
|
||||
LEFT JOIN PUBLIC.tbl_standort USING (standort_id)
|
||||
LEFT JOIN PUBLIC.tbl_firma USING (firma_id)
|
||||
WHERE person_id = ".$this->db_add_param($person_id, FHC_INTEGER)."
|
||||
AND kontakttyp = ".$this->db_add_param($kontakttyp, FHC_STRING);
|
||||
|
||||
if ($order != null)
|
||||
$qry .= " ORDER BY ".$order;
|
||||
|
||||
@@ -30,6 +30,8 @@ class organisationsform extends basis_db
|
||||
public $code;
|
||||
public $bezeichnung;
|
||||
public $rolle;
|
||||
public $bisorgform_kurzbz;
|
||||
public $bezeichnung_mehrsprachig;
|
||||
|
||||
public $result = array();
|
||||
|
||||
@@ -37,9 +39,12 @@ class organisationsform extends basis_db
|
||||
*
|
||||
* Konstruktor
|
||||
*/
|
||||
public function __construct()
|
||||
public function __construct($orgform_kurzbz = null)
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
if($orgform_kurzbz != null)
|
||||
$this->load($orgform_kurzbz);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -48,7 +53,16 @@ class organisationsform extends basis_db
|
||||
*/
|
||||
public function load($orgform_kurzbz)
|
||||
{
|
||||
$qry = "SELECT * FROM bis.tbl_orgform WHERE orgform_kurzbz=".$this->db_add_param($orgform_kurzbz).';';
|
||||
$sprache = new sprache();
|
||||
$bezeichnung_mehrsprachig = $sprache->getSprachQuery('bezeichnung_mehrsprachig');
|
||||
$qry = "SELECT orgform_kurzbz,
|
||||
code,
|
||||
bezeichnung,
|
||||
rolle,
|
||||
bisorgform_kurzbz,
|
||||
$bezeichnung_mehrsprachig
|
||||
FROM bis.tbl_orgform
|
||||
WHERE orgform_kurzbz=".$this->db_add_param($orgform_kurzbz).';';
|
||||
|
||||
if($this->db_query($qry))
|
||||
{
|
||||
@@ -58,6 +72,8 @@ class organisationsform extends basis_db
|
||||
$this->code = $row->code;
|
||||
$this->bezeichnung = $row->bezeichnung;
|
||||
$this->rolle = $this->db_parse_bool($row->rolle);
|
||||
$this->bisorgform_kurzbz = $row->bisorgform_kurzbz;
|
||||
$this->bezeichnung_mehrsprachig = $sprache->parseSprachResult('bezeichnung_mehrsprachig',$row);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -73,7 +89,15 @@ class organisationsform extends basis_db
|
||||
*/
|
||||
public function getAll()
|
||||
{
|
||||
$qry = "SELECT * FROM bis.tbl_orgform";
|
||||
$sprache = new sprache();
|
||||
$bezeichnung_mehrsprachig = $sprache->getSprachQuery('bezeichnung_mehrsprachig');
|
||||
$qry = "SELECT orgform_kurzbz,
|
||||
code,
|
||||
bezeichnung,
|
||||
rolle,
|
||||
bisorgform_kurzbz,
|
||||
$bezeichnung_mehrsprachig
|
||||
FROM bis.tbl_orgform";
|
||||
|
||||
if($this->db_query($qry))
|
||||
{
|
||||
@@ -85,6 +109,8 @@ class organisationsform extends basis_db
|
||||
$orgform->code = $row->code;
|
||||
$orgform->bezeichnung = $row->bezeichnung;
|
||||
$orgform->rolle = $this->db_parse_bool($row->rolle);
|
||||
$orgform->bisorgform_kurzbz = $row->bisorgform_kurzbz;
|
||||
$orgform->bezeichnung_mehrsprachig = $sprache->parseSprachResult('bezeichnung_mehrsprachig',$row);
|
||||
|
||||
$this->result[] = $orgform;
|
||||
}
|
||||
@@ -133,9 +159,16 @@ class organisationsform extends basis_db
|
||||
*/
|
||||
public function getOrgformLV()
|
||||
{
|
||||
$qry = "SELECT *
|
||||
FROM bis.tbl_orgform
|
||||
WHERE orgform_kurzbz NOT IN ('VBB', 'ZGS')
|
||||
$sprache = new sprache();
|
||||
$bezeichnung_mehrsprachig = $sprache->getSprachQuery('bezeichnung_mehrsprachig');
|
||||
$qry = "SELECT orgform_kurzbz,
|
||||
code,
|
||||
bezeichnung,
|
||||
rolle,
|
||||
bisorgform_kurzbz,
|
||||
$bezeichnung_mehrsprachig
|
||||
FROM bis.tbl_orgform
|
||||
WHERE orgform_kurzbz NOT IN ('VBB', 'ZGS')
|
||||
ORDER BY orgform_kurzbz";
|
||||
|
||||
if ($result = $this->db_query($qry))
|
||||
@@ -148,6 +181,8 @@ class organisationsform extends basis_db
|
||||
$orgform->code = $row->code;
|
||||
$orgform->bezeichnung = $row->bezeichnung;
|
||||
$orgform->rolle = $row->rolle;
|
||||
$orgform->bisorgform_kurzbz = $row->bisorgform_kurzbz;
|
||||
$orgform->bezeichnung_mehrsprachig = $sprache->parseSprachResult('bezeichnung_mehrsprachig',$row);
|
||||
|
||||
$this->result[] = $orgform;
|
||||
}
|
||||
|
||||
@@ -424,6 +424,8 @@ class prestudent extends person
|
||||
* Laedt über einen Prestudenten alle anderen Prestudenten einer Person, die aktuell an STG interessiert sind.
|
||||
* @integer $prestudent_id Prestudent ID, über die alle weiteren Prestudenten ermittelt werden sollen.
|
||||
* @boolean $prio Wenn true, dann wird nur der Prestudent mit dem am höchsten priorisierten Studiengang zurückgegeben.
|
||||
* @string $typ Ergebnis nach STG-Typ filtern.
|
||||
* @string $studiengang_kz Ergebnis nach STG-Kennzahl filtern.
|
||||
* return Objekt-Array mit allen Prestudenten einer Person, die aktuell an STG interessiert sind.
|
||||
*/
|
||||
public function getActualInteressenten($prestudent_id, $prio = false, $typ = NULL, $studiengang_kz = NULL)
|
||||
|
||||
@@ -21,7 +21,6 @@
|
||||
* Funktionen zum Pruefen der Passwort Policy und setzen des Passworts
|
||||
*/
|
||||
require_once(dirname(__FILE__).'/../addon.class.php');
|
||||
//require_once(dirname(__FILE__).'/../Crypt_CHAP-1.5.0/CHAP.php');
|
||||
|
||||
// die aktiven Addons werden durchsucht, ob eines davon eine eigene UID Generierung vorsieht
|
||||
// falls ja, wird die Version des Addons genommen, ansonsten die Default Generierung
|
||||
|
||||
@@ -702,6 +702,7 @@ class wochenplan extends basis_db
|
||||
$datum=$datum_mon=$this->datum;
|
||||
$rechte = new benutzerberechtigung();
|
||||
$rechte->getBerechtigungen($user_uid);
|
||||
$reservberechtigt = $rechte->isBerechtigt('lehre/reservierung', null, 'suid');
|
||||
|
||||
for ($i=1; $i<=TAGE_PRO_WOCHE; $i++)
|
||||
{
|
||||
@@ -765,6 +766,12 @@ class wochenplan extends basis_db
|
||||
$reservierung=$lehrstunde->reservierung;
|
||||
}
|
||||
|
||||
$datum_res_lektor_start_m = date('Y-m-d', $datum_res_lektor_start);
|
||||
$datum_res_lektor_ende_m = date('Y-m-d', $datum_res_lektor_ende);
|
||||
$datum_m = date('Y-m-d',$datum);
|
||||
|
||||
$showdelete = $raumres && $this->type=='ort' && (/*$datum>=$datum_now && */$datum_m>=$datum_res_lektor_start_m && $datum_m<=$datum_res_lektor_ende_m);
|
||||
|
||||
if ($gruppieren)
|
||||
{
|
||||
// Unterrichtsnummer (Kollision?)
|
||||
@@ -836,6 +843,14 @@ class wochenplan extends basis_db
|
||||
if (isset($this->std_plan[$i][$j][0]->farbe))
|
||||
echo 'style="background-color: #'.$this->std_plan[$i][$j][0]->farbe.';"';
|
||||
echo '>'.$blink_ein.'<DIV align="center">';
|
||||
|
||||
$ort = $this->std_plan[$i][$j][0]->ort;
|
||||
|
||||
if ($showdelete)
|
||||
{
|
||||
$this->stpltable_deletelink($ort, $datum, $j, $user_uid, $reservberechtigt);
|
||||
}
|
||||
|
||||
// Link zu Details setzten
|
||||
echo '<A class="stpl_detail" onClick="window.open(';
|
||||
echo "'stpl_detail.php";
|
||||
@@ -845,7 +860,7 @@ class wochenplan extends basis_db
|
||||
echo '&sem='.$this->sem;
|
||||
echo '&ver='.$this->ver;
|
||||
echo '&grp='.$this->grp;
|
||||
echo '&ort_kurzbz='.$this->std_plan[$i][$j][0]->ort;
|
||||
echo '&ort_kurzbz='.$ort;
|
||||
echo "','Details', 'height=320,width=550,left=0,top=0,hotkeys=0,resizable=yes,status=no,scrollbars=no,toolbar=no,location=no,menubar=no,dependent=yes');return false;";
|
||||
echo '" title="'.$this->convert_html_chars($titel).'" ';
|
||||
echo ' href="#">';
|
||||
@@ -902,6 +917,12 @@ class wochenplan extends basis_db
|
||||
echo 'style="background-color: #'.$uEinheit['farbe'].'; margin-bottom: 3px;"';
|
||||
echo '>';
|
||||
|
||||
// Löschlink anzeigen
|
||||
if ($showdelete)
|
||||
{
|
||||
$this->stpltable_deletelink($uEinheit['ort'][0], $datum, $j, $user_uid, $reservberechtigt);
|
||||
}
|
||||
|
||||
// Link zu Details setzten
|
||||
echo '<A class="stpl_detail" onClick="window.open(';
|
||||
echo "'stpl_detail.php";
|
||||
@@ -982,37 +1003,22 @@ class wochenplan extends basis_db
|
||||
{
|
||||
$check_all_checkbox='';
|
||||
|
||||
echo '<br><table><tr>';
|
||||
echo '<br><table><tr id="firstinputrow">';
|
||||
echo ' <td>'.$p->t('global/titel').':</td><td><input onchange="if (this.value.length>0 && document.getElementById(\'beschreibung\').value.length<1) {document.getElementById(\'beschreibung\').value=document.getElementById(\'titel\').value;document.getElementById(\'beschreibung\').focus();};" type="text" id="titel" name="titel" size="10" maxlength="10" value="" /></td> '.$this->crlf;
|
||||
echo ' <td>'.$p->t('global/beschreibung').':</td><td colspan="6"> <input onchange="if (this.value.length<1 && document.getElementById(\'titel\').value.length>0) {alert(\'Achtung! Speichern nur mit Beschreibung moeglich!\');this.focus();};" type="text" id="beschreibung" name="beschreibung" size="20" maxlength="32" value="" /> </td>'.$this->crlf;
|
||||
echo ' <td>'.$p->t('global/beschreibung').':</td><td colspan="5"> <input onchange="if (this.value.length<1 && document.getElementById(\'titel\').value.length>0) {alert(\'Achtung! Speichern nur mit Beschreibung moeglich!\');this.focus();};" type="text" id="beschreibung" name="beschreibung" size="20" maxlength="32" value="" /> </td>'.$this->crlf;
|
||||
|
||||
//Pruefen ob die erweiterte Reservierungsrechte vorhanden sind
|
||||
if ($rechte->isBerechtigt('lehre/reservierung', null, 'sui'))
|
||||
{
|
||||
$check_all_checkbox='';
|
||||
//Lektor
|
||||
echo '<td>'.$p->t('lvplan/lektor').':</td>
|
||||
<td><SELECT name="user_uid">'.$this->crlf;
|
||||
|
||||
$qry = "SELECT uid, kurzbz, vorname, nachname FROM campus.vw_mitarbeiter
|
||||
WHERE aktiv=true
|
||||
ORDER BY nachname, uid";
|
||||
|
||||
if ($result = $this->db_query($qry))
|
||||
{
|
||||
while ($row = $this->db_fetch_object($result))
|
||||
{
|
||||
if ($row->uid==$user_uid)
|
||||
$selected='selected="selected"';
|
||||
else
|
||||
$selected='';
|
||||
|
||||
echo '<OPTION value="'.$row->uid.'" '.$selected.'>'.$row->nachname.' '.$row->vorname.' - '.$row->uid.'</OPTION>'.$this->crlf;
|
||||
}
|
||||
}
|
||||
|
||||
echo '</SELECT></td>'.$this->crlf;
|
||||
echo '</tr><tr>'.$this->crlf;
|
||||
echo "<td>".$p->t('lvplan/lektor').":</td>
|
||||
<td><input class='search' placeholder='".$p->t('lvplan/nameEingeben')."' type='text' id='user_uid' size='32' value=''>".$this->crlf;
|
||||
echo '</td>'.$this->crlf;
|
||||
echo '<td> </td>';
|
||||
echo '</tr>';
|
||||
echo '<tr>'.$this->crlf;
|
||||
|
||||
//Studiengaenge Laden fuer die eine erweiterte Reservierungsberechtigung vorhanden ist
|
||||
$stg = new studiengang();
|
||||
@@ -1112,7 +1118,7 @@ class wochenplan extends basis_db
|
||||
echo '</td>';
|
||||
|
||||
echo '</tr></table></form>';
|
||||
echo ' <a href="stpl_reserve_list.php">'.$p->t('lvplan/reservierungenLoeschen').' </a>';
|
||||
echo ' <a href="stpl_reserve_list.php">'.$p->t('lvplan/meineReservierungenAnzeigen').' </a>';
|
||||
}
|
||||
elseif ($this->type=='ort' && $raumReservierbar == false)
|
||||
{
|
||||
@@ -2724,5 +2730,48 @@ class wochenplan extends basis_db
|
||||
}
|
||||
echo ' </tr></table></div></div></div></td></tr></table>'.$crlf;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gibt Link zum Löschen der Reservierungen für einen Ort zu einer Zeit zuürck.
|
||||
* @param $ort
|
||||
* @param $datum
|
||||
* @param $stunde
|
||||
* @param $user_uid eingeloggter User
|
||||
* @param $reservberechtigt erweiterte Reservierungsberechtigung
|
||||
*/
|
||||
private function stpltable_deletelink($ort, $datum, $stunde, $user_uid, $reservberechtigt)
|
||||
{
|
||||
global $p;
|
||||
$deleteberechtigt = false;
|
||||
$reservtodelete = array();
|
||||
|
||||
$qry = "SELECT reservierung_id, insertvon, uid FROM campus.tbl_reservierung
|
||||
WHERE ort_kurzbz=" . $this->db_add_param($ort) . "
|
||||
AND datum = " . $this->db_add_param(date('Y-m-d', $datum)) . "
|
||||
AND stunde = " . $this->db_add_param($stunde);
|
||||
|
||||
if ($result = $this->db_query($qry))
|
||||
{
|
||||
while ($row = $this->db_fetch_object($result))
|
||||
{
|
||||
if ($reservberechtigt || $row->uid == $user_uid || $row->insertvon == $user_uid)
|
||||
{
|
||||
$deleteberechtigt = true;
|
||||
$reservtodelete[] = $row->reservierung_id;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($deleteberechtigt)
|
||||
{
|
||||
$reservetodeleteurl = 'stpl_week.php?type=ort&ort_kurzbz='.$ort.'&datum='.$datum;
|
||||
$reservetodeleteurl .= '&reservtodelete[]='.implode("&reservtodelete[]=", $reservtodelete);
|
||||
echo '<div class="reservdelete">
|
||||
<a href="'.$reservetodeleteurl.'" title="' . $p->t('lvplan/reservierungenLoeschen') . '">
|
||||
<img src="../../../skin/images/cross.png" width="12px" height="12px"/>
|
||||
</a>
|
||||
</div>';
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user