Skip to content

Commit

Permalink
Quick fix with LDAP and spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
gurkin33 committed Mar 8, 2021
1 parent 6a5c129 commit b50b2d3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 4 additions & 2 deletions mavis/Controllers/Controller.php
Expand Up @@ -26,12 +26,13 @@ public function __get($property)

public function in($value = '')
{
$tempArray = explode(" ", trim($value));
$tempArray = preg_split("/\s+/", trim($value), 2);
if ( count($tempArray) <= 1 ) return false;
$this->V_IN[$tempArray[0]]=trim($tempArray[1]);
if ($this->debug) {
if ( $tempArray[0] != 8 ) $myfile = file_put_contents('/var/log/tacacsgui/mavis_debug.txt', $value, FILE_APPEND);
else $myfile = file_put_contents('/var/log/tacacsgui/mavis_debug.txt', '8 <password>'."\n", FILE_APPEND);
//$myfile = file_put_contents('/var/log/tacacsgui/mavis_debug.txt', $value, FILE_APPEND);
}
//if (trim($tempArray[0]) == 4) $username = trim($tempArray[1]);
//if (trim($tempArray[0]) == 8) $password = trim($tempArray[1]);
Expand Down Expand Up @@ -149,7 +150,8 @@ public function out()
$output.= $index.' '.$value."\n";
if ($this->debug) {
if ($index != 8) file_put_contents('/var/log/tacacsgui/mavis_debug.txt', $index.' '.$value."\n", FILE_APPEND);
else file_put_contents('/var/log/tacacsgui/mavis_debug.txt', '8 <password>'."\n", FILE_APPEND);
else file_put_contents('/var/log/tacacsgui/mavis_debug.txt', '8 <password>'."\n", FILE_APPEND);
//file_put_contents('/var/log/tacacsgui/mavis_debug.txt', $index.' '.$value."\n", FILE_APPEND);
}
}
$output.="=".$this->mavis_result."\n";
Expand Down
1 change: 0 additions & 1 deletion mavis/Controllers/LDAP/LDAP.php
Expand Up @@ -56,7 +56,6 @@ public function run()
$this->mavis->result('NAK');
//var_dump($this->adUser->dn[0]); die;
//var_dump( $this->ad->auth()->attempt( $this->adUser->dn[0], $this->mavis->getPassword() ) ); die;

if ( $this->mavis->getVariable(AV_A_TACTYPE) == 'AUTH' ) try {
$nice_try = false;
switch ($this->ldap->type) {
Expand Down

0 comments on commit b50b2d3

Please sign in to comment.