@@ -68,7 +68,7 @@ |
||
68 | 68 | try { |
69 | 69 | $ldapWrapper->read($connection->getConnectionResource(), '', 'objectClass=*', array('dn')); |
70 | 70 | } catch (\Exception $e) { |
71 | - if($e->getCode() === 1) { |
|
71 | + if ($e->getCode() === 1) { |
|
72 | 72 | \OC_JSON::error(array('message' => $l->t('Invalid configuration: Anonymous binding is not allowed.'))); |
73 | 73 | exit; |
74 | 74 | } |
@@ -29,7 +29,7 @@ |
||
29 | 29 | \OC_JSON::checkAppEnabled('user_ldap'); |
30 | 30 | \OC_JSON::callCheck(); |
31 | 31 | |
32 | -$prefix = (string)$_POST['ldap_serverconfig_chooser']; |
|
32 | +$prefix = (string) $_POST['ldap_serverconfig_chooser']; |
|
33 | 33 | $ldapWrapper = new OCA\User_LDAP\LDAP(); |
34 | 34 | $connection = new \OCA\User_LDAP\Connection($ldapWrapper, $prefix); |
35 | 35 | $configuration = $connection->getConfiguration(); |
@@ -30,15 +30,15 @@ |
||
30 | 30 | \OC_JSON::checkAppEnabled('user_ldap'); |
31 | 31 | \OC_JSON::callCheck(); |
32 | 32 | |
33 | -$prefix = (string)$_POST['ldap_serverconfig_chooser']; |
|
33 | +$prefix = (string) $_POST['ldap_serverconfig_chooser']; |
|
34 | 34 | |
35 | 35 | // Checkboxes are not submitted, when they are unchecked. Set them manually. |
36 | 36 | // only legacy checkboxes (Advanced and Expert tab) need to be handled here, |
37 | 37 | // the Wizard-like tabs handle it on their own |
38 | 38 | $chkboxes = array('ldap_configuration_active', 'ldap_override_main_server', |
39 | 39 | 'ldap_turn_off_cert_check'); |
40 | -foreach($chkboxes as $boxid) { |
|
41 | - if(!isset($_POST[$boxid])) { |
|
40 | +foreach ($chkboxes as $boxid) { |
|
41 | + if (!isset($_POST[$boxid])) { |
|
42 | 42 | $_POST[$boxid] = 0; |
43 | 43 | } |
44 | 44 | } |
@@ -35,16 +35,16 @@ discard block |
||
35 | 35 | |
36 | 36 | $l = \OC::$server->getL10N('user_ldap'); |
37 | 37 | |
38 | -if(!isset($_POST['action'])) { |
|
38 | +if (!isset($_POST['action'])) { |
|
39 | 39 | \OC_JSON::error(array('message' => $l->t('No action specified'))); |
40 | 40 | } |
41 | -$action = (string)$_POST['action']; |
|
41 | +$action = (string) $_POST['action']; |
|
42 | 42 | |
43 | 43 | |
44 | -if(!isset($_POST['ldap_serverconfig_chooser'])) { |
|
44 | +if (!isset($_POST['ldap_serverconfig_chooser'])) { |
|
45 | 45 | \OC_JSON::error(array('message' => $l->t('No configuration specified'))); |
46 | 46 | } |
47 | -$prefix = (string)$_POST['ldap_serverconfig_chooser']; |
|
47 | +$prefix = (string) $_POST['ldap_serverconfig_chooser']; |
|
48 | 48 | |
49 | 49 | $ldapWrapper = new \OCA\User_LDAP\LDAP(); |
50 | 50 | $configuration = new \OCA\User_LDAP\Configuration($prefix); |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | |
75 | 75 | $wizard = new \OCA\User_LDAP\Wizard($configuration, $ldapWrapper, $access); |
76 | 76 | |
77 | -switch($action) { |
|
77 | +switch ($action) { |
|
78 | 78 | case 'guessPortAndTLS': |
79 | 79 | case 'guessBaseDN': |
80 | 80 | case 'detectEmailAttribute': |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | case 'countInBaseDN': |
94 | 94 | try { |
95 | 95 | $result = $wizard->$action(); |
96 | - if($result !== false) { |
|
96 | + if ($result !== false) { |
|
97 | 97 | \OC_JSON::success($result->getResultArray()); |
98 | 98 | exit; |
99 | 99 | } |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | try { |
110 | 110 | $loginName = $_POST['ldap_test_loginname']; |
111 | 111 | $result = $wizard->$action($loginName); |
112 | - if($result !== false) { |
|
112 | + if ($result !== false) { |
|
113 | 113 | \OC_JSON::success($result->getResultArray()); |
114 | 114 | exit; |
115 | 115 | } |
@@ -125,14 +125,14 @@ discard block |
||
125 | 125 | case 'save': |
126 | 126 | $key = isset($_POST['cfgkey']) ? $_POST['cfgkey'] : false; |
127 | 127 | $val = isset($_POST['cfgval']) ? $_POST['cfgval'] : null; |
128 | - if($key === false || is_null($val)) { |
|
128 | + if ($key === false || is_null($val)) { |
|
129 | 129 | \OC_JSON::error(array('message' => $l->t('No data specified'))); |
130 | 130 | exit; |
131 | 131 | } |
132 | 132 | $cfg = array($key => $val); |
133 | 133 | $setParameters = array(); |
134 | 134 | $configuration->setConfiguration($cfg, $setParameters); |
135 | - if(!in_array($key, $setParameters)) { |
|
135 | + if (!in_array($key, $setParameters)) { |
|
136 | 136 | \OC_JSON::error(array('message' => $l->t($key. |
137 | 137 | ' Could not set configuration %s', $setParameters[0]))); |
138 | 138 | exit; |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | $server->addPlugin(new \OCA\DAV\Connector\Sabre\LockPlugin()); |
118 | 118 | // Some WebDAV clients do require Class 2 WebDAV support (locking), since |
119 | 119 | // we do not provide locking we emulate it using a fake locking plugin. |
120 | - if($this->request->isUserAgent([ |
|
120 | + if ($this->request->isUserAgent([ |
|
121 | 121 | '/WebDAVFS/', |
122 | 122 | '/OneNote/', |
123 | 123 | '/Microsoft-WebDAV-MiniRedir/', |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | } |
131 | 131 | |
132 | 132 | // wait with registering these until auth is handled and the filesystem is setup |
133 | - $server->on('beforeMethod', function () use ($server, $objectTree, $viewCallBack) { |
|
133 | + $server->on('beforeMethod', function() use ($server, $objectTree, $viewCallBack) { |
|
134 | 134 | // ensure the skeleton is copied |
135 | 135 | $userFolder = \OC::$server->getUserFolder(); |
136 | 136 | |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | ); |
163 | 163 | $server->addPlugin(new \OCA\DAV\Connector\Sabre\QuotaPlugin($view, true)); |
164 | 164 | |
165 | - if($this->userSession->isLoggedIn()) { |
|
165 | + if ($this->userSession->isLoggedIn()) { |
|
166 | 166 | $server->addPlugin(new \OCA\DAV\Connector\Sabre\TagsPlugin($objectTree, $this->tagManager)); |
167 | 167 | $server->addPlugin(new \OCA\DAV\Connector\Sabre\SharesPlugin( |
168 | 168 | $objectTree, |
@@ -6,35 +6,35 @@ |
||
6 | 6 | |
7 | 7 | class ComposerStaticInitProvisioning_API |
8 | 8 | { |
9 | - public static $prefixLengthsPsr4 = array ( |
|
9 | + public static $prefixLengthsPsr4 = array( |
|
10 | 10 | 'O' => |
11 | - array ( |
|
11 | + array( |
|
12 | 12 | 'OCA\\Provisioning_API\\' => 21, |
13 | 13 | ), |
14 | 14 | ); |
15 | 15 | |
16 | - public static $prefixDirsPsr4 = array ( |
|
16 | + public static $prefixDirsPsr4 = array( |
|
17 | 17 | 'OCA\\Provisioning_API\\' => |
18 | - array ( |
|
19 | - 0 => __DIR__ . '/..' . '/../lib', |
|
18 | + array( |
|
19 | + 0 => __DIR__.'/..'.'/../lib', |
|
20 | 20 | ), |
21 | 21 | ); |
22 | 22 | |
23 | - public static $classMap = array ( |
|
24 | - 'OCA\\Provisioning_API\\AppInfo\\Application' => __DIR__ . '/..' . '/../lib/AppInfo/Application.php', |
|
25 | - 'OCA\\Provisioning_API\\Controller\\AUserData' => __DIR__ . '/..' . '/../lib/Controller/AUserData.php', |
|
26 | - 'OCA\\Provisioning_API\\Controller\\AppConfigController' => __DIR__ . '/..' . '/../lib/Controller/AppConfigController.php', |
|
27 | - 'OCA\\Provisioning_API\\Controller\\AppsController' => __DIR__ . '/..' . '/../lib/Controller/AppsController.php', |
|
28 | - 'OCA\\Provisioning_API\\Controller\\GroupsController' => __DIR__ . '/..' . '/../lib/Controller/GroupsController.php', |
|
29 | - 'OCA\\Provisioning_API\\Controller\\UsersController' => __DIR__ . '/..' . '/../lib/Controller/UsersController.php', |
|
30 | - 'OCA\\Provisioning_API\\FederatedFileSharingFactory' => __DIR__ . '/..' . '/../lib/FederatedFileSharingFactory.php', |
|
31 | - 'OCA\\Provisioning_API\\Middleware\\Exceptions\\NotSubAdminException' => __DIR__ . '/..' . '/../lib/Middleware/Exceptions/NotSubAdminException.php', |
|
32 | - 'OCA\\Provisioning_API\\Middleware\\ProvisioningApiMiddleware' => __DIR__ . '/..' . '/../lib/Middleware/ProvisioningApiMiddleware.php', |
|
23 | + public static $classMap = array( |
|
24 | + 'OCA\\Provisioning_API\\AppInfo\\Application' => __DIR__.'/..'.'/../lib/AppInfo/Application.php', |
|
25 | + 'OCA\\Provisioning_API\\Controller\\AUserData' => __DIR__.'/..'.'/../lib/Controller/AUserData.php', |
|
26 | + 'OCA\\Provisioning_API\\Controller\\AppConfigController' => __DIR__.'/..'.'/../lib/Controller/AppConfigController.php', |
|
27 | + 'OCA\\Provisioning_API\\Controller\\AppsController' => __DIR__.'/..'.'/../lib/Controller/AppsController.php', |
|
28 | + 'OCA\\Provisioning_API\\Controller\\GroupsController' => __DIR__.'/..'.'/../lib/Controller/GroupsController.php', |
|
29 | + 'OCA\\Provisioning_API\\Controller\\UsersController' => __DIR__.'/..'.'/../lib/Controller/UsersController.php', |
|
30 | + 'OCA\\Provisioning_API\\FederatedFileSharingFactory' => __DIR__.'/..'.'/../lib/FederatedFileSharingFactory.php', |
|
31 | + 'OCA\\Provisioning_API\\Middleware\\Exceptions\\NotSubAdminException' => __DIR__.'/..'.'/../lib/Middleware/Exceptions/NotSubAdminException.php', |
|
32 | + 'OCA\\Provisioning_API\\Middleware\\ProvisioningApiMiddleware' => __DIR__.'/..'.'/../lib/Middleware/ProvisioningApiMiddleware.php', |
|
33 | 33 | ); |
34 | 34 | |
35 | 35 | public static function getInitializer(ClassLoader $loader) |
36 | 36 | { |
37 | - return \Closure::bind(function () use ($loader) { |
|
37 | + return \Closure::bind(function() use ($loader) { |
|
38 | 38 | $loader->prefixLengthsPsr4 = ComposerStaticInitProvisioning_API::$prefixLengthsPsr4; |
39 | 39 | $loader->prefixDirsPsr4 = ComposerStaticInitProvisioning_API::$prefixDirsPsr4; |
40 | 40 | $loader->classMap = ComposerStaticInitProvisioning_API::$classMap; |
@@ -6,13 +6,13 @@ |
||
6 | 6 | $baseDir = $vendorDir; |
7 | 7 | |
8 | 8 | return array( |
9 | - 'OCA\\Provisioning_API\\AppInfo\\Application' => $baseDir . '/../lib/AppInfo/Application.php', |
|
10 | - 'OCA\\Provisioning_API\\Controller\\AUserData' => $baseDir . '/../lib/Controller/AUserData.php', |
|
11 | - 'OCA\\Provisioning_API\\Controller\\AppConfigController' => $baseDir . '/../lib/Controller/AppConfigController.php', |
|
12 | - 'OCA\\Provisioning_API\\Controller\\AppsController' => $baseDir . '/../lib/Controller/AppsController.php', |
|
13 | - 'OCA\\Provisioning_API\\Controller\\GroupsController' => $baseDir . '/../lib/Controller/GroupsController.php', |
|
14 | - 'OCA\\Provisioning_API\\Controller\\UsersController' => $baseDir . '/../lib/Controller/UsersController.php', |
|
15 | - 'OCA\\Provisioning_API\\FederatedFileSharingFactory' => $baseDir . '/../lib/FederatedFileSharingFactory.php', |
|
16 | - 'OCA\\Provisioning_API\\Middleware\\Exceptions\\NotSubAdminException' => $baseDir . '/../lib/Middleware/Exceptions/NotSubAdminException.php', |
|
17 | - 'OCA\\Provisioning_API\\Middleware\\ProvisioningApiMiddleware' => $baseDir . '/../lib/Middleware/ProvisioningApiMiddleware.php', |
|
9 | + 'OCA\\Provisioning_API\\AppInfo\\Application' => $baseDir.'/../lib/AppInfo/Application.php', |
|
10 | + 'OCA\\Provisioning_API\\Controller\\AUserData' => $baseDir.'/../lib/Controller/AUserData.php', |
|
11 | + 'OCA\\Provisioning_API\\Controller\\AppConfigController' => $baseDir.'/../lib/Controller/AppConfigController.php', |
|
12 | + 'OCA\\Provisioning_API\\Controller\\AppsController' => $baseDir.'/../lib/Controller/AppsController.php', |
|
13 | + 'OCA\\Provisioning_API\\Controller\\GroupsController' => $baseDir.'/../lib/Controller/GroupsController.php', |
|
14 | + 'OCA\\Provisioning_API\\Controller\\UsersController' => $baseDir.'/../lib/Controller/UsersController.php', |
|
15 | + 'OCA\\Provisioning_API\\FederatedFileSharingFactory' => $baseDir.'/../lib/FederatedFileSharingFactory.php', |
|
16 | + 'OCA\\Provisioning_API\\Middleware\\Exceptions\\NotSubAdminException' => $baseDir.'/../lib/Middleware/Exceptions/NotSubAdminException.php', |
|
17 | + 'OCA\\Provisioning_API\\Middleware\\ProvisioningApiMiddleware' => $baseDir.'/../lib/Middleware/ProvisioningApiMiddleware.php', |
|
18 | 18 | ); |
@@ -31,25 +31,25 @@ |
||
31 | 31 | \OC_JSON::checkAppEnabled('user_ldap'); |
32 | 32 | \OC_JSON::callCheck(); |
33 | 33 | |
34 | -$subject = (string)$_POST['ldap_clear_mapping']; |
|
34 | +$subject = (string) $_POST['ldap_clear_mapping']; |
|
35 | 35 | $mapping = null; |
36 | 36 | try { |
37 | - if($subject === 'user') { |
|
37 | + if ($subject === 'user') { |
|
38 | 38 | $mapping = new UserMapping(\OC::$server->getDatabaseConnection()); |
39 | 39 | $result = $mapping->clearCb( |
40 | - function ($uid) { |
|
40 | + function($uid) { |
|
41 | 41 | \OC::$server->getUserManager()->emit('\OC\User', 'preUnassignedUserId', [$uid]); |
42 | 42 | }, |
43 | - function ($uid) { |
|
43 | + function($uid) { |
|
44 | 44 | \OC::$server->getUserManager()->emit('\OC\User', 'postUnassignedUserId', [$uid]); |
45 | 45 | } |
46 | 46 | ); |
47 | - } else if($subject === 'group') { |
|
47 | + } else if ($subject === 'group') { |
|
48 | 48 | $mapping = new GroupMapping(\OC::$server->getDatabaseConnection()); |
49 | 49 | $result = $mapping->clear(); |
50 | 50 | } |
51 | 51 | |
52 | - if($mapping === null || !$result) { |
|
52 | + if ($mapping === null || !$result) { |
|
53 | 53 | $l = \OC::$server->getL10N('user_ldap'); |
54 | 54 | throw new \Exception($l->t('Failed to clear the mappings.')); |
55 | 55 | } |
@@ -51,16 +51,16 @@ |
||
51 | 51 | * @since 14.0.0 |
52 | 52 | */ |
53 | 53 | public function render(): string { |
54 | - return '<li>' . |
|
55 | - '<a id="directLink-container">' . |
|
56 | - '<span class="icon ' . Util::sanitizeHTML($this->getIcon()) . '"></span>' . |
|
57 | - '<label for="directLink">' . Util::sanitizeHTML($this->getLabel()) . '</label>' . |
|
58 | - '</a>' . |
|
59 | - '</li>' . |
|
60 | - '<li>' . |
|
61 | - '<span class="menuitem">' . |
|
62 | - '<input id="directLink" type="text" readonly="" value="' . Util::sanitizeHTML($this->getLink()) . '">' . |
|
63 | - '</span>' . |
|
54 | + return '<li>'. |
|
55 | + '<a id="directLink-container">'. |
|
56 | + '<span class="icon '.Util::sanitizeHTML($this->getIcon()).'"></span>'. |
|
57 | + '<label for="directLink">'.Util::sanitizeHTML($this->getLabel()).'</label>'. |
|
58 | + '</a>'. |
|
59 | + '</li>'. |
|
60 | + '<li>'. |
|
61 | + '<span class="menuitem">'. |
|
62 | + '<input id="directLink" type="text" readonly="" value="'.Util::sanitizeHTML($this->getLink()).'">'. |
|
63 | + '</span>'. |
|
64 | 64 | '</li>'; |
65 | 65 | } |
66 | 66 | } |