|
Lines 457-546
C4::Auth - Authenticates Koha users
Link Here
|
| 457 |
=head1 LDAP Configuration |
457 |
=head1 LDAP Configuration |
| 458 |
|
458 |
|
| 459 |
This module is specific to LDAP authentication. It requires Net::LDAP package and one or more |
459 |
This module is specific to LDAP authentication. It requires Net::LDAP package and one or more |
| 460 |
working LDAP servers. |
460 |
working LDAP servers. |
| 461 |
To use it : |
461 |
To use it : |
| 462 |
* Modify ldapserver element in KOHA_CONF |
462 |
* Modify ldapserver element in KOHA_CONF |
| 463 |
* Establish field mapping in <mapping> element. |
463 |
* Establish field mapping in <mapping> element. |
| 464 |
|
464 |
|
| 465 |
For example, if your user records are stored according to the inetOrgPerson schema, RFC#2798, |
465 |
For example, if your user records are stored according to the inetOrgPerson schema, RFC#2798, |
| 466 |
the username would match the "uid" field, and the password should match the "userpassword" field. |
466 |
the username would match the "uid" field, and the password should match the "userpassword" field. |
| 467 |
|
467 |
|
| 468 |
Make sure that ALL required fields are populated by your LDAP database (and mapped in KOHA_CONF). |
468 |
Make sure that ALL required fields are populated by your LDAP database (and mapped in KOHA_CONF). |
| 469 |
What are the required fields? Well, in mysql you can check the database table "borrowers" like this: |
469 |
What are the required fields? Well, in mysql you can check the database table "borrowers" like this: |
| 470 |
|
470 |
|
| 471 |
mysql> show COLUMNS from borrowers; |
471 |
mysql> show COLUMNS from borrowers; |
| 472 |
+---------------------+--------------+------+-----+---------+----------------+ |
472 |
+---------------------+--------------+------+-----+---------+----------------+ |
| 473 |
| Field | Type | Null | Key | Default | Extra | |
473 |
| Field | Type | Null | Key | Default | Extra | |
| 474 |
+---------------------+--------------+------+-----+---------+----------------+ |
474 |
+---------------------+--------------+------+-----+---------+----------------+ |
| 475 |
| borrowernumber | int(11) | NO | PRI | NULL | auto_increment | |
475 |
| borrowernumber | int(11) | NO | PRI | NULL | auto_increment | |
| 476 |
| cardnumber | varchar(16) | YES | UNI | NULL | | |
476 |
| cardnumber | varchar(16) | YES | UNI | NULL | | |
| 477 |
| surname | mediumtext | NO | | NULL | | |
477 |
| surname | mediumtext | NO | | NULL | | |
| 478 |
| firstname | text | YES | | NULL | | |
478 |
| firstname | text | YES | | NULL | | |
| 479 |
| title | mediumtext | YES | | NULL | | |
479 |
| title | mediumtext | YES | | NULL | | |
| 480 |
| othernames | mediumtext | YES | | NULL | | |
480 |
| othernames | mediumtext | YES | | NULL | | |
| 481 |
| initials | text | YES | | NULL | | |
481 |
| initials | text | YES | | NULL | | |
| 482 |
| streetnumber | varchar(10) | YES | | NULL | | |
482 |
| streetnumber | varchar(10) | YES | | NULL | | |
| 483 |
| streettype | varchar(50) | YES | | NULL | | |
483 |
| streettype | varchar(50) | YES | | NULL | | |
| 484 |
| address | mediumtext | NO | | NULL | | |
484 |
| address | mediumtext | NO | | NULL | | |
| 485 |
| address2 | text | YES | | NULL | | |
485 |
| address2 | text | YES | | NULL | | |
| 486 |
| city | mediumtext | NO | | NULL | | |
486 |
| city | mediumtext | NO | | NULL | | |
| 487 |
| state | mediumtext | YES | | NULL | | |
487 |
| state | mediumtext | YES | | NULL | | |
| 488 |
| zipcode | varchar(25) | YES | | NULL | | |
488 |
| zipcode | varchar(25) | YES | | NULL | | |
| 489 |
| country | text | YES | | NULL | | |
489 |
| country | text | YES | | NULL | | |
| 490 |
| email | mediumtext | YES | | NULL | | |
490 |
| email | mediumtext | YES | | NULL | | |
| 491 |
| phone | text | YES | | NULL | | |
491 |
| phone | text | YES | | NULL | | |
| 492 |
| mobile | varchar(50) | YES | | NULL | | |
492 |
| mobile | varchar(50) | YES | | NULL | | |
| 493 |
| fax | mediumtext | YES | | NULL | | |
493 |
| fax | mediumtext | YES | | NULL | | |
| 494 |
| emailpro | text | YES | | NULL | | |
494 |
| emailpro | text | YES | | NULL | | |
| 495 |
| phonepro | text | YES | | NULL | | |
495 |
| phonepro | text | YES | | NULL | | |
| 496 |
| B_streetnumber | varchar(10) | YES | | NULL | | |
496 |
| B_streetnumber | varchar(10) | YES | | NULL | | |
| 497 |
| B_streettype | varchar(50) | YES | | NULL | | |
497 |
| B_streettype | varchar(50) | YES | | NULL | | |
| 498 |
| B_address | varchar(100) | YES | | NULL | | |
498 |
| B_address | varchar(100) | YES | | NULL | | |
| 499 |
| B_address2 | text | YES | | NULL | | |
499 |
| B_address2 | text | YES | | NULL | | |
| 500 |
| B_city | mediumtext | YES | | NULL | | |
500 |
| B_city | mediumtext | YES | | NULL | | |
| 501 |
| B_state | mediumtext | YES | | NULL | | |
501 |
| B_state | mediumtext | YES | | NULL | | |
| 502 |
| B_zipcode | varchar(25) | YES | | NULL | | |
502 |
| B_zipcode | varchar(25) | YES | | NULL | | |
| 503 |
| B_country | text | YES | | NULL | | |
503 |
| B_country | text | YES | | NULL | | |
| 504 |
| B_email | text | YES | | NULL | | |
504 |
| B_email | text | YES | | NULL | | |
| 505 |
| B_phone | mediumtext | YES | | NULL | | |
505 |
| B_phone | mediumtext | YES | | NULL | | |
| 506 |
| dateofbirth | date | YES | | NULL | | |
506 |
| dateofbirth | date | YES | | NULL | | |
| 507 |
| branchcode | varchar(10) | NO | MUL | | | |
507 |
| branchcode | varchar(10) | NO | MUL | | | |
| 508 |
| categorycode | varchar(10) | NO | MUL | | | |
508 |
| categorycode | varchar(10) | NO | MUL | | | |
| 509 |
| dateenrolled | date | YES | | NULL | | |
509 |
| dateenrolled | date | YES | | NULL | | |
| 510 |
| dateexpiry | date | YES | | NULL | | |
510 |
| dateexpiry | date | YES | | NULL | | |
| 511 |
| gonenoaddress | tinyint(1) | YES | | NULL | | |
511 |
| gonenoaddress | tinyint(1) | YES | | NULL | | |
| 512 |
| lost | tinyint(1) | YES | | NULL | | |
512 |
| lost | tinyint(1) | YES | | NULL | | |
| 513 |
| debarred | date | YES | | NULL | | |
513 |
| debarred | date | YES | | NULL | | |
| 514 |
| debarredcomment | varchar(255) | YES | | NULL | | |
514 |
| debarredcomment | varchar(255) | YES | | NULL | | |
| 515 |
| contactname | mediumtext | YES | | NULL | | |
515 |
| contactname | mediumtext | YES | | NULL | | |
| 516 |
| contactfirstname | text | YES | | NULL | | |
516 |
| contactfirstname | text | YES | | NULL | | |
| 517 |
| contacttitle | text | YES | | NULL | | |
517 |
| contacttitle | text | YES | | NULL | | |
| 518 |
| borrowernotes | mediumtext | YES | | NULL | | |
518 |
| borrowernotes | mediumtext | YES | | NULL | | |
| 519 |
| relationship | varchar(100) | YES | | NULL | | |
519 |
| relationship | varchar(100) | YES | | NULL | | |
| 520 |
| ethnicity | varchar(50) | YES | | NULL | | |
520 |
| ethnicity | varchar(50) | YES | | NULL | | |
| 521 |
| ethnotes | varchar(255) | YES | | NULL | | |
521 |
| ethnotes | varchar(255) | YES | | NULL | | |
| 522 |
| sex | varchar(1) | YES | | NULL | | |
522 |
| sex | varchar(1) | YES | | NULL | | |
| 523 |
| password | varchar(30) | YES | | NULL | | |
523 |
| password | varchar(30) | YES | | NULL | | |
| 524 |
| flags | int(11) | YES | | NULL | | |
524 |
| flags | int(11) | YES | | NULL | | |
| 525 |
| userid | varchar(30) | YES | MUL | NULL | | |
525 |
| userid | varchar(30) | YES | MUL | NULL | | |
| 526 |
| opacnote | mediumtext | YES | | NULL | | |
526 |
| opacnote | mediumtext | YES | | NULL | | |
| 527 |
| contactnote | varchar(255) | YES | | NULL | | |
527 |
| contactnote | varchar(255) | YES | | NULL | | |
| 528 |
| sort1 | varchar(80) | YES | | NULL | | |
528 |
| sort1 | varchar(80) | YES | | NULL | | |
| 529 |
| sort2 | varchar(80) | YES | | NULL | | |
529 |
| sort2 | varchar(80) | YES | | NULL | | |
| 530 |
| altcontactfirstname | varchar(255) | YES | | NULL | | |
530 |
| altcontactfirstname | varchar(255) | YES | | NULL | | |
| 531 |
| altcontactsurname | varchar(255) | YES | | NULL | | |
531 |
| altcontactsurname | varchar(255) | YES | | NULL | | |
| 532 |
| altcontactaddress1 | varchar(255) | YES | | NULL | | |
532 |
| altcontactaddress1 | varchar(255) | YES | | NULL | | |
| 533 |
| altcontactaddress2 | varchar(255) | YES | | NULL | | |
533 |
| altcontactaddress2 | varchar(255) | YES | | NULL | | |
| 534 |
| altcontactaddress3 | varchar(255) | YES | | NULL | | |
534 |
| altcontactaddress3 | varchar(255) | YES | | NULL | | |
| 535 |
| altcontactstate | mediumtext | YES | | NULL | | |
535 |
| altcontactstate | mediumtext | YES | | NULL | | |
| 536 |
| altcontactzipcode | varchar(50) | YES | | NULL | | |
536 |
| altcontactzipcode | varchar(50) | YES | | NULL | | |
| 537 |
| altcontactcountry | text | YES | | NULL | | |
537 |
| altcontactcountry | text | YES | | NULL | | |
| 538 |
| altcontactphone | varchar(50) | YES | | NULL | | |
538 |
| altcontactphone | varchar(50) | YES | | NULL | | |
| 539 |
| smsalertnumber | varchar(50) | YES | | NULL | | |
539 |
| smsalertnumber | varchar(50) | YES | | NULL | | |
| 540 |
| privacy | int(11) | NO | | 1 | | |
540 |
| privacy | int(11) | NO | | 1 | | |
| 541 |
+---------------------+--------------+------+-----+---------+----------------+ |
541 |
+---------------------+--------------+------+-----+---------+----------------+ |
| 542 |
66 rows in set (0.00 sec) |
542 |
66 rows in set (0.00 sec) |
| 543 |
Where Null="NO", the field is required. |
543 |
Where Null="NO", the field is required. |
| 544 |
|
544 |
|
| 545 |
=head1 KOHA_CONF and field mapping |
545 |
=head1 KOHA_CONF and field mapping |
| 546 |
|
546 |
|
|
Lines 678-688
sprintf()
Link Here
|
| 678 |
# Using attrs instead of {asn}->attributes |
678 |
# Using attrs instead of {asn}->attributes |
| 679 |
# ======================================== |
679 |
# ======================================== |
| 680 |
# |
680 |
# |
| 681 |
# LDAP key: ->{ cn} = ARRAY w/ 3 members. |
681 |
# LDAP key: ->{ cn} = ARRAY w/ 3 members. |
| 682 |
# LDAP key: ->{ cn}->{ sss} = sss |
682 |
# LDAP key: ->{ cn}->{ sss} = sss |
| 683 |
# LDAP key: ->{ cn}->{ Steve Smith} = Steve Smith |
683 |
# LDAP key: ->{ cn}->{ Steve Smith} = Steve Smith |
| 684 |
# LDAP key: ->{ cn}->{Steve S. Smith} = Steve S. Smith |
684 |
# LDAP key: ->{ cn}->{Steve S. Smith} = Steve S. Smith |
| 685 |
# |
685 |
# |
| 686 |
# LDAP key: ->{ givenname} = ARRAY w/ 1 members. |
686 |
# LDAP key: ->{ givenname} = ARRAY w/ 1 members. |
| 687 |
# LDAP key: ->{ givenname}->{Steve} = Steve |
687 |
# LDAP key: ->{ givenname}->{Steve} = Steve |
| 688 |
# |
688 |
# |