forked from robertrossmann/AD-X
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
24 changed files
with
1,772 additions
and
365 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<?php | ||
|
||
/** | ||
* AD-X | ||
* | ||
* Licensed under the BSD (3-Clause) license | ||
* For full copyright and license information, please see the LICENSE file | ||
* | ||
* @copyright 2012-2013 Robert Rossmann | ||
* @author Robert Rossmann <[email protected]> | ||
* @link https://github.com/Alaneor/AD-X | ||
* @license http:https://choosealicense.com/licenses/bsd-3-clause BSD (3-Clause) License | ||
*/ | ||
|
||
namespace ADX\Attributes; | ||
|
||
/** | ||
* Overrides the msExchMailboxGuid attribute behaviour | ||
* | ||
* This class provides special functionality when converting the raw data into ldap-compatible value. | ||
* The problem is that ldap refuses to accept a hex string as an input for writing into this attribute - | ||
* it has to be converted to a binary string. | ||
*/ | ||
class MsExchMailboxGuid extends \ADX\Core\Attribute | ||
{ | ||
/** | ||
* Convert the raw ldap data into binary string instead of keeping it as hexadecimal value | ||
* | ||
* @return array The data in binary format | ||
*/ | ||
public function ldap_data() | ||
{ | ||
$data = parent::ldap_data(); | ||
$data = str_ireplace( '\\', '', $data[0] ); | ||
|
||
return [hex2bin( $data )]; | ||
} | ||
} |
Oops, something went wrong.