PageRenderTime 58ms CodeModel.GetById 30ms RepoModel.GetById 0ms app.codeStats 0ms

/passwd/config/backends.php

https://github.com/wrobel/horde
PHP | 597 lines | 378 code | 20 blank | 199 comment | 0 complexity | 7596979aabbcd43715be0be6319b552d MD5 | raw file
Possible License(s): BSD-2-Clause, AGPL-1.0, LGPL-2.1, LGPL-3.0, BSD-3-Clause, LGPL-2.0, GPL-2.0
  1. <?php
  2. /**
  3. * This file provides defaults for backends people use to change their
  4. * passwords.
  5. *
  6. * IMPORTANT: DO NOT EDIT THIS FILE!
  7. * Local overrides MUST be placed in backends.local.php or backends.d/.
  8. * If the 'vhosts' setting has been enabled in Horde's configuration, you can
  9. * use backends-servername.php.
  10. *
  11. * There are a number of properties that you can set for each backend:
  12. *
  13. * name: This is the plaintext, english name that you want displayed to people
  14. * if you are using the drop down server list. Also displayed on the
  15. * main page (input form).
  16. *
  17. * policy: The password policies for this backend. You are responsible for the
  18. * sanity checks of these options. Options are:
  19. *
  20. * minLength: Minimum length of the password
  21. * maxLength: Maximum length of the password
  22. * maxSpace: Maximum number of white space characters
  23. *
  24. * The following are the types of characters required in a password.
  25. * Either specific characters, character classes, or both can be
  26. * required. Specific types are:
  27. *
  28. * minUpper: Minimum number of uppercase characters
  29. * minLower: Minimum number of lowercase characters
  30. * minNumeric: Minimum number of numeric characters (0-9)
  31. * minAlphaNum: Minimum number of alphanumeric characters
  32. * minAlpha: Minimum number of alphabetic characters
  33. * minSymbol: Minimum number of alphabetic characters
  34. *
  35. * Alternatively (or in addition to), the minimum number of character
  36. * classes can be configured by setting the following. The valid range
  37. * is 0 through 4 character classes may be required for a password. The
  38. * classes are: 'upper', 'lower', 'number', and 'symbol'. For example:
  39. * A password of 'p@ssw0rd' satisfies three classes ('number', 'lower',
  40. * and 'symbol'), while 'passw0rd' only satisfies two classes ('lower'
  41. * and 'symbols').
  42. *
  43. * minClasses: Minimum number (0 through 4) of character classes.
  44. *
  45. * driver: The Passwd driver used to change the password. Valid values are
  46. * currently:
  47. *
  48. * horde: Change the password via the configured horde
  49. * authentication driver
  50. * ldap: Change the password on a ldap server
  51. * smbldap: Change the password on a ldap server for both
  52. * ldap and samba auth
  53. * sql: Change the password for sql authentication
  54. * (exim, pam_mysql, horde)
  55. * poppassd: Change the password via a poppassd server
  56. * smbpasswd: Change the password via the smbpasswd command
  57. * expect: Change the password via an expect script
  58. * vmailmgr: Change the password via a local vmailmgr daemon
  59. * vpopmail: Change the password for sql based vpopmail
  60. * servuftp: Change the password via a servuftp server
  61. * pine: Change the password in a Pine-encoded file
  62. * composite: Allows you to chain multiple drivers together
  63. *
  64. * no_reset: Do not reset the authenticated user's credentials on success.
  65. *
  66. * params: A params array containing any additional information that the Passwd
  67. * driver needs.
  68. *
  69. * The following is a list of supported encryption/hashing methods
  70. * supported by Passwd.
  71. *
  72. * 1) plain
  73. * 2) aprmd5
  74. * 3) crypt or crypt-des
  75. * 4) crypt-blowfish
  76. * 5) crypt-md5
  77. * 6) crypt-sha256
  78. * 7) crypt-sha512
  79. * 8) md5-base64
  80. * 9) md5-hex
  81. * 10) msad
  82. * 11) sha or sha1
  83. * 12) sha256 or ssha256
  84. * 13) smd5
  85. * 14) ssha
  86. *
  87. * md5 passwords have caused some problems in the past because there
  88. * are different definitions of what is a "md5 password". Systems
  89. * implement them in a different manner. If you are using OpenLDAP as
  90. * your backend or have migrated your passwords from your OS based
  91. * passwd file, you will need to use the md5-base64 hashing method. If
  92. * you are using a SQL database or used the PHP md5() method to create
  93. * your passwords, you will need to use the md5-hex hashing method.
  94. *
  95. * preferred: This is only useful if you want to use the same backend.php file
  96. * for different machines: if the Hostname of the Passwd Machine is
  97. * identical to one of those in the preferred list, then the
  98. * corresponding option in the select box will include SELECTED,
  99. * i.e. it is selected per default. Otherwise the first entry in the
  100. * list is selected.
  101. *
  102. * show_encryption: If you are using the ldap, sql or vpopmail backends you
  103. * have the choice whether or not to store the encryption type
  104. * with the password. If you are using for example an SQL
  105. * based PAM you will most likely not want to store the
  106. * encryption type as it would cause PAM to never match the
  107. * passwords.
  108. */
  109. $backends['hordeauth'] = array (
  110. 'disabled' => true,
  111. 'name' => 'Horde Authentication',
  112. 'preferred' => '',
  113. 'policy' => array(
  114. 'minLength' => 6,
  115. 'minNumeric' => 1,
  116. ),
  117. 'driver' => 'Horde',
  118. );
  119. $backends['hordesql'] = array (
  120. 'disabled' => false,
  121. 'name' => 'Horde SQL Authentication',
  122. 'preferred' => '',
  123. 'policy' => array(
  124. 'minLength' => 6,
  125. 'minNumeric' => 1,
  126. ),
  127. 'driver' => 'Sql',
  128. 'params' => array_merge(
  129. $GLOBALS['conf']['sql'],
  130. array('table' => 'horde_users',
  131. 'user_col' => 'user_uid',
  132. 'pass_col' => 'user_pass',
  133. 'show_encryption' => false,
  134. 'encryption' => $GLOBALS['conf']['auth']['params']['encryption'])
  135. ),
  136. );
  137. $backends['poppassd'] = array(
  138. 'disabled' => true,
  139. 'name' => 'Poppassd Server',
  140. 'preferred' => '',
  141. 'policy' => array(
  142. 'minLength' => 6,
  143. 'minNumeric' => 1,
  144. ),
  145. 'driver' => 'Poppassd',
  146. 'params' => array(
  147. 'host' => 'localhost',
  148. 'port' => 106
  149. ),
  150. );
  151. $backends['servuftp'] = array(
  152. 'disabled' => true,
  153. 'name' => 'Serv-U FTP Server',
  154. 'preferred' => '',
  155. 'policy' => array(
  156. 'minLength' => 6,
  157. 'minNumeric' => 1,
  158. ),
  159. 'driver' => 'Servuftp',
  160. 'params' => array(
  161. 'host' => 'localhost',
  162. 'port' => 106,
  163. 'timeout' => 30
  164. ),
  165. );
  166. $backends['expect'] = array(
  167. 'disabled' => true,
  168. 'name' => 'Expect Script',
  169. 'preferred' => '',
  170. 'policy' => array(
  171. 'minLength' => 6,
  172. 'minNumeric' => 1,
  173. ),
  174. 'driver' => 'Expect',
  175. 'params' => array(
  176. 'program' => '/usr/bin/expect',
  177. 'script' => PASSWD_BASE . '/scripts/passwd-expect',
  178. 'params' => '-telnet -host localhost -output /tmp/passwd.log'
  179. ),
  180. );
  181. $backends['sudo_expect'] = array(
  182. 'disabled' => true,
  183. 'name' => 'Expect with Sudo Script',
  184. 'preferred' => '',
  185. 'policy' => array(
  186. 'minLength' => 6,
  187. 'minNumeric' => 1,
  188. ),
  189. 'driver' => 'Procopen',
  190. 'params' => array(
  191. 'program' => '/usr/bin/expect '
  192. . PASSWD_BASE . '/scripts/passwd_expect -sudo'
  193. ),
  194. );
  195. $backends['smbpasswd'] = array(
  196. 'disabled' => true,
  197. 'name' => 'Samba Server',
  198. 'preferred' => '',
  199. 'policy' => array(
  200. 'minLength' => 6,
  201. 'minNumeric' => 1,
  202. ),
  203. 'driver' => 'Smbpasswd',
  204. 'params' => array(
  205. 'program' => '/usr/bin/smbpasswd',
  206. 'host' => 'localhost'
  207. ),
  208. );
  209. // NOTE: to set the ldap userdn, see horde/config/hooks.php
  210. $backends['ldap'] = array(
  211. 'disabled' => true,
  212. 'name' => 'LDAP Server',
  213. 'preferred' => '',
  214. 'policy' => array(
  215. 'minLength' => 6,
  216. 'minNumeric' => 1,
  217. ),
  218. 'driver' => 'Ldap',
  219. 'params' => array(
  220. 'host' => 'localhost',
  221. 'port' => 389,
  222. 'basedn' => 'o=example.com',
  223. // LDAP object key attribute.
  224. 'uid' => 'uid',
  225. // The attribute storing the password.
  226. 'attribute' => 'userPassword',
  227. // These attributes will enable shadow password policies.
  228. // 'shadowlastchange' => 'shadowLastChange',
  229. // 'shadowmin' => 'shadowMin',
  230. // This will be appended to the username when looking for the userdn.
  231. 'realm' => '',
  232. // Use this filter when searching for the user's DN.
  233. 'filter' => '',
  234. // Hash method to use when storing the password
  235. 'encryption' => 'crypt',
  236. // Whether to enable TLS for this LDAP connection
  237. // Note: make sure that the host matches cn in the server certificate.
  238. 'tls' => false
  239. ),
  240. );
  241. // NOTE: to set the ldap userdn, see horde/config/hooks.php
  242. $backends['ldapadmin'] = array(
  243. 'disabled' => true,
  244. 'name' => 'LDAP Server with Admin Bindings',
  245. 'preferred' => '',
  246. 'policy' => array(
  247. 'minLength' => 6,
  248. 'minNumeric' => 1,
  249. ),
  250. 'driver' => 'Ldap',
  251. 'params' => array(
  252. 'host' => 'localhost',
  253. 'port' => 389,
  254. 'basedn' => 'o=example.com',
  255. 'admindn' => 'cn=admin,o=example.com',
  256. 'adminpw' => 'somepassword',
  257. // LDAP object key attribute.
  258. 'uid' => 'uid',
  259. // The attribute storing the password.
  260. 'attribute' => 'userPassword',
  261. // These attributes will enable shadow password policies.
  262. // 'shadowlastchange' => 'shadowLastChange',
  263. // 'shadowmin' => 'shadowMin',
  264. // This will be appended to the username when looking for the userdn.
  265. 'realm' => '',
  266. // Use this filter when searching for the user's DN.
  267. 'filter' => '',
  268. // Hash method to use when storing the password
  269. 'encryption' => 'crypt',
  270. // If set, should be 0 or 1. See the LDAP documentation about the
  271. // corresponding parameter REFERRALS.
  272. // Windows 2003 Server require to set this parameter to 0
  273. // 'referrals' => 0,
  274. // Whether to enable TLS for this LDAP connection
  275. // Note: make sure that the host matches cn in the server certificate.
  276. 'tls' => false
  277. ),
  278. );
  279. // NOTE: to set the ldap userdn, see horde/config/hooks.php
  280. // NOTE: to make work with samba 2.x schema you must change lm_attribute and
  281. // nt_attribute
  282. $backends['smbldap'] = array(
  283. 'disabled' => true,
  284. 'name' => 'Samba/LDAP Server',
  285. 'preferred' => '',
  286. 'policy' => array(
  287. 'minLength' => 6,
  288. 'minNumeric' => 1,
  289. ),
  290. 'driver' => 'Smbldap',
  291. 'params' => array(
  292. 'host' => 'localhost',
  293. 'port' => 389,
  294. 'basedn' => 'o=example.com',
  295. // LDAP object key attribute.
  296. 'uid' => 'uid',
  297. // The attribute storing the password.
  298. 'attribute' => 'userPassword',
  299. // This will be appended to the username when looking for the userdn.
  300. 'realm' => '',
  301. // Use this filter when searching for the user's DN.
  302. 'filter' => '',
  303. // Hash method to use when storing the password
  304. 'encryption' => 'crypt',
  305. // Whether to enable TLS for this LDAP connection
  306. // Note: make sure that the host matches cn in the server certificate.
  307. 'tls' => false,
  308. // If any of the following attributes are commented out, they
  309. // won't be set on the LDAP server.
  310. 'lm_attribute' => 'sambaLMPassword',
  311. 'nt_attribute' => 'sambaNTPassword',
  312. 'pw_set_attribute' => 'sambaPwdLastSet',
  313. 'pw_expire_attribute' => 'sambaPwdMustChange',
  314. // The number of days until samba passwords expire. If this
  315. // is commented out, passwords will never expire.
  316. 'pw_expire_time' => 180,
  317. ),
  318. );
  319. $backends['sql'] = array (
  320. 'disabled' => true,
  321. 'name' => 'SQL Server',
  322. 'preferred' => '',
  323. 'policy' => array(
  324. 'minLength' => 6,
  325. 'minNumeric' => 1,
  326. ),
  327. 'driver' => 'Sql',
  328. 'params' => array(
  329. 'phptype' => 'mysql',
  330. 'hostspec' => 'localhost',
  331. 'username' => 'dbuser',
  332. 'password' => 'dbpasswd',
  333. 'encryption' => 'md5-hex',
  334. 'database' => 'db',
  335. 'table' => 'users',
  336. 'user_col' => 'user_uid',
  337. 'pass_col' => 'user_pass',
  338. 'show_encryption' => false
  339. // The following two settings allow you to specify custom queries for
  340. // lookup and modify functions if special functions need to be
  341. // performed. In places where a username or a password needs to be
  342. // used, refer to this placeholder reference:
  343. // %d -> gets substituted with the domain
  344. // %u -> gets substituted with the user
  345. // %U -> gets substituted with the user without a domain part
  346. // %p -> gets substituted with the plaintext password
  347. // %e -> gets substituted with the encrypted password
  348. //
  349. // 'query_lookup' => 'SELECT user_pass FROM horde_users WHERE user_uid = %u',
  350. // 'query_modify' => 'UPDATE horde_users SET user_pass = %e WHERE user_uid = %u',
  351. ),
  352. );
  353. $backends['mailmgr'] = array(
  354. 'disabled' => true,
  355. 'name' => 'VMailMgr Server',
  356. 'preferred' => '',
  357. 'policy' => array(),
  358. 'driver' => 'Vmailmgr',
  359. 'params' => array(
  360. 'vmailinc' => '/your/path/to/the/vmail.inc'
  361. ),
  362. );
  363. $backends['vpopmail'] = array (
  364. 'disabled' => true,
  365. 'name' => 'Vpopmail Server',
  366. 'preferred' => '',
  367. 'policy' => array(
  368. 'minLength' => 6,
  369. 'minNumeric' => 1,
  370. ),
  371. 'driver' => 'Vpopmail',
  372. 'params' => array(
  373. 'phptype' => 'mysql',
  374. 'hostspec' => 'localhost',
  375. 'username' => '',
  376. 'password' => '',
  377. 'encryption' => 'crypt',
  378. 'database' => 'vpopmail',
  379. 'table' => 'vpopmail',
  380. 'name' => 'pw_name',
  381. 'domain' => 'pw_domain',
  382. 'passwd' => 'pw_passwd',
  383. 'clear_passwd' => 'pw_clear_passwd',
  384. 'use_clear_passwd' => true,
  385. 'show_encryption' => true
  386. ),
  387. );
  388. $backends['pine'] = array(
  389. 'disabled' => true,
  390. 'name' => 'Pine Password File',
  391. 'preferred' => '',
  392. 'policy' => array(
  393. 'minLength' => 6,
  394. 'minNumeric' => 1,
  395. ),
  396. 'driver' => 'Pine',
  397. 'no_reset' => true,
  398. 'params' => array(
  399. // FTP server information.
  400. 'host' => 'localhost',
  401. 'port' => '21',
  402. 'path' => '',
  403. 'file' => '.pinepw',
  404. // Connect using the just-passed-in password?
  405. 'use_new_passwd' => false,
  406. // Host string to look for in the encrypted file.
  407. 'imaphost' => 'localhost'
  408. ),
  409. );
  410. $backends['kolab'] = array(
  411. 'disabled' => true,
  412. 'name' => 'Local Kolab Server',
  413. 'preferred' => '',
  414. 'policy' => array(
  415. 'minLength' => 6,
  416. 'minNumeric' => 1,
  417. ),
  418. 'driver' => 'Kolab',
  419. 'params' => array(),
  420. );
  421. $backends['myscript'] = array(
  422. 'disabled' => true,
  423. 'name' => 'Custom Script',
  424. 'preferred' => '',
  425. 'policy' => array(
  426. 'minLength' => 6,
  427. 'minNumeric' => 1,
  428. ),
  429. 'driver' => 'Procopen',
  430. 'params' => array(
  431. 'program' => '/path/to/my/script + myargs'
  432. ),
  433. );
  434. // This is an example configuration for the http driver. This allows
  435. // connecting to an arbitrary URL that contains a password change form.
  436. // The params 'username','oldPasswd','passwd1', and 'passwd2' params should be
  437. // set to the name of the respective form input elements on the html form. If
  438. // there are additional form fields that the form requires, define them in the
  439. // 'fields' array in the form 'formFieldName' => 'formFieldValue'. The driver
  440. // attempts to determine the success or failure based on searching the returned
  441. // html page for the values listed in the 'eval_results' array.
  442. $backends['http'] = array(
  443. 'disabled' => true,
  444. 'name' => 'HTTP Server',
  445. 'preferred' => '',
  446. 'policy' => array(
  447. 'minLength' => 6,
  448. 'minNumeric' => 1,
  449. ),
  450. 'driver' => 'Http',
  451. 'params' => array(
  452. 'url' => 'http://www.example.com/psoft/servlet/psoft.hsphere.CP',
  453. 'username' => 'mbox',
  454. 'oldPasswd' => 'old_password',
  455. 'passwd1' => 'password',
  456. 'passwd2' => 'password2',
  457. 'fields' => array(
  458. 'action' => 'change_mbox_password',
  459. 'ftemplate' => 'design/mail_passw.html'
  460. ),
  461. 'eval_results' => array(
  462. 'success' => 'Password successfully changed',
  463. 'badPass' => 'Bad old password',
  464. 'badUser' => 'Mailbox not found'
  465. ),
  466. ),
  467. );
  468. $backends['soap'] = array(
  469. 'disabled' => true,
  470. 'name' => 'SOAP Server',
  471. 'preferred' => '',
  472. 'policy' => array(
  473. 'minLength' => 6,
  474. 'minNumeric' => 1,
  475. ),
  476. 'driver' => 'Soap',
  477. 'params' => array(
  478. // If this service doesn't have a WSDL, the 'location' and 'uri'
  479. // parameters below must be specified instead.
  480. 'wsdl' => 'http://www.example.com/service.wsdl',
  481. 'method' => 'changePassword',
  482. // This is the order of the arguments to the method specified above.
  483. 'arguments' => array('username', 'oldpassword', 'newpassword'),
  484. // These parameters are directly passed to the SoapClient object, see
  485. // http://ww.php.net/manual/en/soapclient.soapclient.php for a
  486. // complete list of possible parameters.
  487. 'soap_params' => array(
  488. 'location' => '',
  489. 'uri' => '',
  490. ),
  491. ),
  492. );
  493. // This is an example configuration for Postfix.admin 2.3.
  494. // Set the 'password_policy' section as you wish.
  495. // In most installations you probably only need to change the
  496. // hostspec and/or password fields.
  497. $backends['postfixadmin'] = array (
  498. 'disabled' => true,
  499. 'name' => 'Postfix Admin server',
  500. 'preferred' => '',
  501. 'policy' => array(
  502. 'minLength' => 6,
  503. 'maxLength' => 20,
  504. 'minNumeric' => 1,
  505. ),
  506. 'driver' => 'Sql',
  507. 'params' => array(
  508. 'phptype' => 'mysql',
  509. 'hostspec' => 'localhost',
  510. 'username' => 'postfix',
  511. 'password' => 'PASSWORD',
  512. 'encryption' => 'crypt-md5',
  513. 'database' => 'postfix',
  514. 'table' => 'mailbox',
  515. 'user_col' => 'username',
  516. 'pass_col' => 'password',
  517. 'show_encryption' => false,
  518. // The following two settings allow you to specify custom queries for
  519. // lookup and modify functions if special functions need to be
  520. // performed. In places where a username or a password needs to be
  521. // used, refer to this placeholder reference:
  522. // %d -> gets substituted with the domain
  523. // %u -> gets substituted with the user
  524. // %U -> gets substituted with the user without a domain part
  525. // %p -> gets substituted with the plaintext password
  526. // %e -> gets substituted with the encrypted password
  527. //
  528. 'query_lookup' => 'SELECT password FROM mailbox WHERE username = %u and active = 1',
  529. 'query_modify' => 'UPDATE mailbox SET password = %e WHERE username = %u'
  530. ),
  531. );
  532. // This is an example configuration for chaining multiple drivers to allow for
  533. // syncing of passwords across many backends using the composite driver as a
  534. // wrapper.
  535. //
  536. // Each of the subdrivers may contain an optional parameter called 'required'
  537. // that, when set to true, will cause the rest of the drivers be skipped if a
  538. // particular one fails.
  539. $backends['composite'] = array(
  540. 'disabled' => true,
  541. 'name' => 'All Services',
  542. 'preferred' => '',
  543. 'policy' => array(
  544. 'minLength' => 6,
  545. 'minNumeric' => 1,
  546. ),
  547. 'driver' => 'Composite',
  548. 'params' => array('drivers' => array(
  549. 'sql' => array(
  550. 'name' => 'Horde Authentication',
  551. 'driver' => 'Sql',
  552. 'required' => true,
  553. 'params' => array(
  554. 'phptype' => 'mysql',
  555. 'hostspec' => 'localhost',
  556. 'username' => 'horde',
  557. 'password' => '',
  558. 'encryption' => 'md5-hex',
  559. 'database' => 'horde',
  560. 'table' => 'horde_users',
  561. 'user_col' => 'user_uid',
  562. 'pass_col' => 'user_pass',
  563. 'show_encryption' => false
  564. // 'query_lookup' => '',
  565. // 'query_modify' => '',
  566. ),
  567. ),
  568. 'smbpasswd' => array(
  569. 'name' => 'Samba Server',
  570. 'driver' => 'Smbpasswd',
  571. 'params' => array(
  572. 'program' => '/usr/bin/smbpasswd',
  573. 'host' => 'localhost',
  574. ),
  575. ),
  576. )),
  577. );