{"action":"created","issue":{"url":"https://api.github.com/repos/Adldap2/Adldap2/issues/38","labels_url":"https://api.github.com/repos/Adldap2/Adldap2/issues/38/labels{/name}","comments_url":"https://api.github.com/repos/Adldap2/Adldap2/issues/38/comments","events_url":"https://api.github.com/repos/Adldap2/Adldap2/issues/38/events","html_url":"https://github.com/Adldap2/Adldap2/issues/38","id":100328325,"number":38,"title":"unable to create a new user (Fatal error: Models/User.php on line 418)","user":{"login":"kichetof","id":12150996,"avatar_url":"https://avatars.githubusercontent.com/u/12150996?v=3","gravatar_id":"","url":"https://api.github.com/users/kichetof","html_url":"https://github.com/kichetof","followers_url":"https://api.github.com/users/kichetof/followers","following_url":"https://api.github.com/users/kichetof/following{/other_user}","gists_url":"https://api.github.com/users/kichetof/gists{/gist_id}","starred_url":"https://api.github.com/users/kichetof/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kichetof/subscriptions","organizations_url":"https://api.github.com/users/kichetof/orgs","repos_url":"https://api.github.com/users/kichetof/repos","events_url":"https://api.github.com/users/kichetof/events{/privacy}","received_events_url":"https://api.github.com/users/kichetof/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Adldap2/Adldap2/labels/bug","name":"bug","color":"fc2929"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":30,"created_at":"2015-08-11T14:41:22Z","updated_at":"2015-08-14T14:56:45Z","closed_at":"2015-08-14T14:56:45Z","body":"Hi guy!\r\nWe encounter a bug when we want to create a new user.\r\nEverything works very well for authentificate (many thanks for this really helpfully class!).\r\n\r\nThis is our code:\r\n\r\n```php\r\n// ... action before\r\ntry {\r\n        $option = array('account_suffix'        => ACCOUNT_SUFFIX,\r\n                        'base_dn'               => BASE_DN,\r\n                        'domain_controllers'    => unserialize(DOMAIN_CONTROLLERS),\r\n                        'admin_username'        => ADMIN_USERNAME,\r\n                        'admin_password'        => ADMIN_PASSWORD,\r\n                        'use_ssl'               => true,\r\n                       );\r\n\r\n        $adldap = new adLDAP($option);\r\n\r\n        $user = $adldap->users()->newInstance();\r\n        $user->setCommonName($attributes['firstname'] . \" \" . mb_strtoupper($attributes['surname']));\r\n        $user->setFirstName($attributes['firstname']);\r\n        $user->setLastName($attributes['surname']);\r\n        $user->setTitle($attributes['title']);\r\n        $user->setDepartment($attributes['department']);\r\n        $user->setTelephoneNumber($attributes['ipphone']);\r\n        $user->setCompany($attributes['company']);\r\n        $user->setEmail($attributes['email']);\r\n        $user->setPassword($attributes['password']);\r\n        $user->disable();\r\n\r\n        $dn = $user->getDnBuilder();\r\n        $dn->addCn($user->getCommonName());\r\n        $dn->addOu('Users');\r\n        $dn->addDc('local');\r\n        $dn->addDc('ad');\r\n        $dn->addDc('domain');\r\n\r\n        $user->setDn($dn);\r\n\r\n        if($user->save()){\r\n            echo \"Ok\";\r\n        }else{\r\n            echo \"ERROR\";\r\n        }\r\n    }\r\n    catch (adLDAPException $e) {\r\n        echo $e;\r\n        exit();\r\n    }\r\n// ... action after\r\n```\r\n\r\nWhen we `$user->setPassword`, a FATAL ERROR occurs:\r\n\r\n<b>Fatal error</b>:  Call to a member function isUsingSSL() on null in <b>/dev-web/AD/vendor/adldap2/adldap2/src/Models/User.php</b> on line <b>418</b>\r\n\r\nThe function `isUsingSSL()` seem to occurs this error but we don't know why because we set `'use_ssl' => true` or `'use_ssl' => 1` on the ldap config and not null ?!\r\n\r\nOur `$option` works well to bind a user, so after many hours of research, we ask you to help us to find a way to solve this problem!\r\n\r\nHope you guy can help us and enjoy your great class!!! :)\r\nTof\r\n\r\n_Server info:\r\nDebian 8\r\nPHP 5.6.9-0+deb8u1\r\nApache/2.4.10_\r\n\r\n_Another info:\r\nAn application that doesn't use this class is able to modify the password using SSL on the same server_"},"comment":{"url":"https://api.github.com/repos/Adldap2/Adldap2/issues/comments/131136487","html_url":"https://github.com/Adldap2/Adldap2/issues/38#issuecomment-131136487","issue_url":"https://api.github.com/repos/Adldap2/Adldap2/issues/38","id":131136487,"user":{"login":"stevebauman","id":6421846,"avatar_url":"https://avatars.githubusercontent.com/u/6421846?v=3","gravatar_id":"","url":"https://api.github.com/users/stevebauman","html_url":"https://github.com/stevebauman","followers_url":"https://api.github.com/users/stevebauman/followers","following_url":"https://api.github.com/users/stevebauman/following{/other_user}","gists_url":"https://api.github.com/users/stevebauman/gists{/gist_id}","starred_url":"https://api.github.com/users/stevebauman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stevebauman/subscriptions","organizations_url":"https://api.github.com/users/stevebauman/orgs","repos_url":"https://api.github.com/users/stevebauman/repos","events_url":"https://api.github.com/users/stevebauman/events{/privacy}","received_events_url":"https://api.github.com/users/stevebauman/received_events","type":"User","site_admin":false},"created_at":"2015-08-14T14:56:45Z","updated_at":"2015-08-14T14:56:45Z","body":"Sounds good! And no problem at all, thanks for all the information and for helping me improve Adldap2!"}}