<?xml version="1.0" encoding="UTF-8"?>

<rss version="2.0"
 xmlns:blogChannel="http://backend.userland.com/blogChannelModule"
>

<channel>
<title><![CDATA[KOHA: ldap]]></title>
<link>https://saturn.ffzg.hr/koha/index.cgi?action=weblog_display;category=ldap</link>
<description></description>
<pubDate>Fri, 26 Feb 2010 17:30:20 -0000</pubDate>
<webMaster>root@saturn.ffzg.hr</webMaster>
<generator>Socialtext Workspace v2.19.0.2</generator>

<item>
<title><![CDATA[LDAP]]></title>
<link>https://saturn.ffzg.hr/koha/index.cgi?ldap</link>
<description><![CDATA[<div>Creator: Marijana Glavica</div><hr/><div>Tags: for:dpavlin, korisnici, ldap</div><hr/><div class="wiki">
<p>
Kako podesiti Kohu da radi s LDAP bazom?</p>
<p>
Video prezentacije o Virtual LDAP-u: <a target="_blank" title="(external link)" href="http://html5tv.rot13.org/HULK-Virtual_LDAP.html">http://html5tv.rot13.org/HULK-Virtual_LDAP.html</a></p>
<p>
Prezentacija: <span class="nlw_phrase"><a href="https://saturn.ffzg.hr/koha/index.cgi/hulk-Virtual-LDAP.odp?action=attachments_download;page_name=ldap;id=20100224211715-0-14304">hulk-Virtual-LDAP.odp</a><!-- wiki: {file: hulk-=Virtual-=LDAP.odp} --></span></p>
<div class="nlw_phrase"><table class="wafl_container">
  <tr>
    <td>
      <div class="wafl_box">
        
          <div class="wafl_titlebox">
            <div class="wafl_title">
              
                Contents: [KOHA]
              
            </div>
          </div>
          <div class="wafl_items">
            
              <div class="wiki">
<ul>
<li><span class="nlw_phrase"><a title="section link" href="https://saturn.ffzg.hr/koha/index.cgi?koha#C5_A1to_nam_omogu_C4_87ava_koha">KOHA (Što nam omogućava Koha?)</a><!-- wiki: {link: [KOHA] Što nam omogućava Koha?} --></span></li>
<li><span class="nlw_phrase"><a title="section link" href="https://saturn.ffzg.hr/koha/index.cgi?koha#kako_vidjeti_strukturu_ldap_baze">KOHA (Kako vidjeti strukturu LDAP baze?)</a><!-- wiki: {link: [KOHA] Kako vidjeti strukturu LDAP baze?} --></span></li>
<li><span class="nlw_phrase"><a title="section link" href="https://saturn.ffzg.hr/koha/index.cgi?koha#logiranje_korisnika_sa_login_ffzg_hr">KOHA (Logiranje korisnika sa login@ffzg.hr)</a><!-- wiki: {link: [KOHA] Logiranje korisnika sa login@ffzg.hr} --></span></li>

<ul>
<li><span class="nlw_phrase"><a title="section link" href="https://saturn.ffzg.hr/koha/index.cgi?koha#koha_ldap_konfiguracija">KOHA (Koha LDAP konfiguracija)</a><!-- wiki: {link: [KOHA] Koha LDAP konfiguracija} --></span></li>
<li><span class="nlw_phrase"><a title="section link" href="https://saturn.ffzg.hr/koha/index.cgi?koha#auth_as_user_promjene_prvi_poku_C5_A1aj">KOHA (auth as user promjene (prvi pokušaj))</a><!-- wiki: {link: [KOHA] auth as user promjene (prvi pokušaj)} --></span></li>
<li><span class="nlw_phrase"><a title="section link" href="https://saturn.ffzg.hr/koha/index.cgi?koha#ldaps_na_upstream_ldap">KOHA (ldaps na upstream LDAP)</a><!-- wiki: {link: [KOHA] ldaps na upstream LDAP} --></span></li>
<li><span class="nlw_phrase"><a title="section link" href="https://saturn.ffzg.hr/koha/index.cgi?koha#cardnumber_ne_dolazi_iz_ldap_a">KOHA (cardnumber ne dolazi iz ldap-a)</a><!-- wiki: {link: [KOHA] cardnumber ne dolazi iz ldap-=a} --></span></li>
<li><span class="nlw_phrase"><a title="section link" href="https://saturn.ffzg.hr/koha/index.cgi?koha#izbaciti_sve_promjene_izvan_kohe_trenutno_rje_C5_A1enje">KOHA (izbaciti sve promjene izvan Kohe (TRENUTNO RJEŠENJE))</a><!-- wiki: {link: [KOHA] izbaciti sve promjene izvan Kohe (TRENUTNO RJEŠENJE)} --></span></li>
</ul>
<li><span class="nlw_phrase"><a title="section link" href="https://saturn.ffzg.hr/koha/index.cgi?koha#koje_podatke_imamo_u_ldap_bazi">KOHA (Koje podatke imamo u LDAP bazi?)</a><!-- wiki: {link: [KOHA] Koje podatke imamo u LDAP bazi?} --></span></li>
<li><span class="nlw_phrase"><a title="section link" href="https://saturn.ffzg.hr/koha/index.cgi?koha#linkovi">KOHA (Linkovi)</a><!-- wiki: {link: [KOHA] Linkovi} --></span></li>
</ul>
</div>

            
            
          </div>
        
      </div>
    </td>
  </tr>
</table>
<!-- wiki: {toc: }
--></div><br /><br /><h1 id="C5_A1to_nam_omogu_C4_87ava_koha">Što nam omogućava Koha?</h1>
<ul>
<li>otvaranje novih korisnika koji postoje u LDAP-u (replicate, uključeno)</li>
<li>sinhronizacija podataka između LDAP-a i kohe kod svakog logiranja korisnika (update, isključeno)</li>
</ul>
<p>
Time dobivamo nove korisnike prvi puta kada se ulogiraju.</p>
<h1 id="kako_vidjeti_strukturu_ldap_baze">Kako vidjeti strukturu LDAP baze?</h1>
<pre>
ldapvi --host _hostname_:389 -d
ldapvi --host _hostname_:389 -d uid=_username_
</pre>
<br /><h1 id="logiranje_korisnika_sa_login_ffzg_hr">Logiranje korisnika sa <a href="mailto:login@ffzg.hr">login@ffzg.hr</a></h1>
<p>
Greška:</p>
<pre>
[Tue Jan 13 23:58:36 2009] opac-user.pl: LDAP Auth rejected : invalid password for user 'mglavica@ffzg.hr'. LDAP error #50: LDAP_INSUFFICIENT_ACCESS
[Tue Jan 13 23:58:36 2009] opac-user.pl: # The client does not have sufficient access to perform the requested
[Tue Jan 13 23:58:36 2009] opac-user.pl: operation
</pre>
<br /><h2 id="koha_ldap_konfiguracija">Koha LDAP konfiguracija</h2>
<span class="nlw_phrase"><div class="wiki-include-page">
<div class="wiki-include-title"><a href='https://saturn.ffzg.hr/koha/index.cgi?koha_ldap_config' >Koha LDAP config</a> </div>
<div class="wiki-include-content">
<h1 id="provjeriti_verziju">Provjeriti verziju</h1>
<pre>
dpavlin@koha-dev:/srv/koha$ grep VERSION /srv/koha/C4/Auth_with_ldap.pm 
use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS $debug);
        $VERSION = 3.10;        # set the version for version checking
</pre>
<br /><h1 id="etc_koha_koha_conf_xml">/etc/koha/koha-conf.xml</h1>
<pre>
&lt;ldapserver id=&quot;ldapserver&quot; listenref=&quot;ldapserver&quot;&gt;
&lt;!--
 &lt;hostname&gt;ldaps://ldap.ffzg.hr&lt;/hostname&gt;
--&gt;
 &lt;hostname&gt;ldap://localhost:1389&lt;/hostname&gt;
 &lt;base&gt;dc=ffzg,dc=hr&lt;/base&gt;

 &lt;replicate&gt;1&lt;/replicate&gt;  &lt;!-- add new users from LDAP to Koha database --&gt;
 &lt;update&gt;0&lt;/update&gt;        &lt;!-- update existing users in Koha database --&gt;

 &lt;auth_by_bind&gt;1&lt;/auth_by_bind&gt;
 &lt;principal_name&gt;%s&lt;/principal_name&gt; &lt;!-- optional, for auth_by_bind: a printf format to make userPrincipalName from koha userid --&gt;

 &lt;mapping&gt;            &lt;!-- match koha SQL field names to your LDAP record field names --&gt;
    &lt;firstname   is=&quot;givenname&quot;     &gt;&lt;/firstname&gt;
    &lt;surname     is=&quot;sn&quot;            &gt;&lt;/surname&gt;
    &lt;address     is=&quot;ffzg-ml_postanska_adresa_0&quot; &gt;&lt;/address&gt;
&lt;!--
    &lt;city        is=&quot;ffzg-prebivaliste_mjesto&quot; &gt;&lt;/city&gt;
--&gt;
    &lt;city        is=&quot;ffzg-ml_postanska_adresa_1&quot; &gt;&lt;/city&gt;
    &lt;zipcode     is=&quot;ffzg-prebivaliste_postanski_broj&quot;&gt;&lt;/zipcode&gt;

    &lt;branchcode  is=&quot;local-branch&quot;        &gt;FFZG&lt;/branchcode&gt;
    &lt;userid      is=&quot;hredupersonuniqueid&quot;  &gt;&lt;/userid&gt;
    &lt;password    is=&quot;userpassword&quot;  &gt;&lt;/password&gt;
    &lt;email       is=&quot;mail&quot;          &gt;&lt;/email&gt;
    &lt;categorycode is=&quot;local-categorycode&quot;  &gt;IMP&lt;/categorycode&gt;

    &lt;dateofbirth is=&quot;ffzg-datum_rodjenja&quot; &gt;&lt;/dateofbirth&gt;
    &lt;sex is=&quot;ffzg-spol&quot; &gt;&lt;/sex&gt;
    &lt;phone is=&quot;ffzg-ml_telefoni_fixed&quot;&gt;&lt;/phone&gt;
    &lt;mobile is=&quot;ffzg-ml_telefoni_mobile&quot;&gt;&lt;/mobile&gt;

 &lt;/mapping&gt;
&lt;/ldapserver&gt;
</pre>
<br /><p>
Koristi <a href="https://saturn.ffzg.hr/koha/index.cgi?ldap_rewrite" title="(200 months) Dio [Koha virtual ldap] repozitorja http svn.rot13.org index.cgi virtual-ldap log bin ldap-rewrite.p...">LDAP rewrite</a></p>
<p>
Da bi sve radilo potrebno je ugasiti <tt>ExtendedPatronAttributes</tt> na <a target="_blank" title="(external link)" href="https://10.60.0.252:8443/cgi-bin/koha/admin/preferences.pl?tab=patrons">https://10.60.0.252:8443/cgi-bin/koha/admin/preferences.pl?tab=patrons</a></p>
</div></div><!-- wiki: {include: [Koha LDAP config]} --></span><br /><br /><h2 id="auth_as_user_promjene_prvi_poku_C5_A1aj">auth as user promjene (prvi pokušaj)</h2>
<p>
Koha konfiguracija skoro radi, osim što je LDAP DN <tt>login@ffzg.hr</tt> umjesto <tt>uid=login,dc=ffzg,dc=hr</tt></p>
<p>
Ali, kako se spajamo na pravi ldap.ffzg.hr preko naše proxy skripte koja obogaćuje zapis podacima,<br />
na tom mjestu <a target="_blank" title="(external link)" href="http://svn.rot13.org/index.cgi/virtual-ldap/revision/?rev=59">rewritamo i DN u ispravan oblik<!-- wiki-renamed-hyperlink "rewritamo i DN u ispravan oblik"<http://svn.rot13.org/index.cgi/virtual=-ldap/revision/?rev=59> --></a></p>
<ul>
<li><a target="_blank" title="(external link)" href="http://koha-dev.rot13.org:8081/cgi-bin/gitweb.cgi?p=koha-ffzg.git;a=commit;h=01bcd8bb8d84e85d29a0bb395757742cab06f102">popravljeno sa promjenom<!-- wiki-renamed-hyperlink "popravljeno sa promjenom"<http://koha=-dev.rot13.org:8081/cgi=-bin/gitweb.cgi?p=koha=-ffzg.git;a=commit;h=01bcd8bb8d84e85d29a0bb395757742cab06f102> --></a></li>
<li><span class="nlw_phrase"><a href="https://saturn.ffzg.hr/koha/index.cgi/koha-ldap-bind-as-user.diff?action=attachments_download;page_name=ldap;id=20090121190416-0-22179">koha-ldap-bind-as-user.diff</a><!-- wiki: {file: koha-=ldap-=bind-=as-=user.diff} --></span></li>
</ul>
<p>
i konfiguracijom u <tt>/etc/koha/koha-conf.xml</tt></p>
<pre>
&lt;ldapserver id=&quot;ldapserver&quot; listenref=&quot;ldapserver&quot;&gt;
 &lt;hostname&gt;ldaps://ldap.ffzg.hr&lt;/hostname&gt;
 &lt;base&gt;dc=ffzg,dc=hr&lt;/base&gt;

 &lt;replicate&gt;1&lt;/replicate&gt;  &lt;!-- add new users from LDAP to Koha database --&gt;
 &lt;update&gt;1&lt;/update&gt;        &lt;!-- update existing users in Koha database --&gt;
 &lt;mapping&gt;            &lt;!-- match koha SQL field names to your LDAP record field names --&gt;
        &lt;firstname   is=&quot;givenname&quot;     &gt;&lt;/firstname&gt;
        &lt;surname     is=&quot;sn&quot;            &gt;&lt;/surname&gt;
        &lt;address     is=&quot;ffzg-ml_postanska_adresa_0&quot; &gt;&lt;/address&gt;
&lt;!--
        &lt;city        is=&quot;ffzg-prebivaliste_mjesto&quot; &gt;&lt;/city&gt;
--&gt;
        &lt;city        is=&quot;ffzg-ml_postanska_adresa_1&quot; &gt;&lt;/city&gt;
        &lt;zipcode     is=&quot;ffzg-prebivaliste_postanski_broj&quot;&gt;&lt;/zipcode&gt;

        &lt;branchcode  is=&quot;local-branch&quot;        &gt;FFZG&lt;/branchcode&gt;
        &lt;userid      is=&quot;hredupersonuniqueid&quot;  &gt;&lt;/userid&gt;
        &lt;password    is=&quot;userpassword&quot;  &gt;&lt;/password&gt;
        &lt;email       is=&quot;mail&quot;          &gt;&lt;/email&gt;
        &lt;categorycode is=&quot;local-categorycode&quot;  &gt;IMP&lt;/categorycode&gt;

        &lt;dateofbirth is=&quot;ffzg-datum_rodjenja&quot; &gt;&lt;/dateofbirth&gt;
        &lt;sex is=&quot;ffzg-spol&quot; &gt;&lt;/sex&gt;
        &lt;phone is=&quot;ffzg-ml_telefoni_fixed&quot;&gt;&lt;/phone&gt;
        &lt;mobile is=&quot;ffzg-ml_telefoni_mobile&quot;&gt;&lt;/mobile&gt;

 &lt;/mapping&gt;
&lt;/ldapserver&gt;
</pre>
<br /><ul>
<li>Sva imena polja iz LDAP-a moraju biti napisana <strong>malim slovima</strong> (hredupersonid umjesto hrEduPersonUniqueID)</li>
<li><a target="_blank" title="(external link)" href="http://bugs.rot13.org/rt/Ticket/Display.html?id=355">#355: LDAP: hrEduPersonUniqueID -&gt; userid<!-- wiki-renamed-hyperlink "#355: LDAP: hrEduPersonUniqueID =-> userid"<http://bugs.rot13.org/rt/Ticket/Display.html?id=355> --></a></li>
</ul>
<h2 id="ldaps_na_upstream_ldap">ldaps na upstream LDAP</h2>
<p>
<tt>ldaps</tt> zahtjeva instalaciju IO::Socket::SSL sa</p>
<pre>
sudo apt-get install libio-socket-ssl-perl
</pre>
<br /><h2 id="cardnumber_ne_dolazi_iz_ldap_a">cardnumber ne dolazi iz ldap-a</h2>
<p>
Osim kod prvog ulogiravanja korisnika kada mu se postavlja isti kao <tt>mail</tt></p>
<ul>
<li><a target="_blank" title="(external link)" href="http://koha-dev.rot13.org:8081/cgi-bin/gitweb.cgi?p=koha-ffzg.git;a=blobdiff;f=C4/Auth_with_ldap.pm;h=3f965a729a794ddc9c023310e565adb8dbf2c332;hp=7cd5b6e6d103aba36512d9f3939b74b397de6ff1;hb=42dcfcdf338312380e7851212931dd846833ab4e;hpb=01bcd8bb8d84e85d29a0bb395757742cab06f102">git<!-- wiki-renamed-hyperlink "git"<http://koha=-dev.rot13.org:8081/cgi=-bin/gitweb.cgi?p=koha=-ffzg.git;a=blobdiff;f=C4/Auth_with_ldap.pm;h=3f965a729a794ddc9c023310e565adb8dbf2c332;hp=7cd5b6e6d103aba36512d9f3939b74b397de6ff1;hb=42dcfcdf338312380e7851212931dd846833ab4e;hpb=01bcd8bb8d84e85d29a0bb395757742cab06f102> --></a></li>
<li><span class="nlw_phrase"><a href="https://saturn.ffzg.hr/koha/index.cgi/koha-ldap-keep-cardnumber.diff?action=attachments_download;page_name=ldap;id=20090121190417-1-22179">koha-ldap-keep-cardnumber.diff</a><!-- wiki: {file: koha-=ldap-=keep-=cardnumber.diff} --></span></li>
</ul>
<h2 id="izbaciti_sve_promjene_izvan_kohe_trenutno_rje_C5_A1enje">izbaciti sve promjene izvan Kohe (TRENUTNO RJEŠENJE)</h2>
<p>
Da bi nam upgrade na novije verzije Kohe bio što jednostavniji, odlučili smo sve LDAP promjene na kraju izbaciti iz Kohe u <a href="https://saturn.ffzg.hr/koha/index.cgi?ldap_rewrite" title="(200 months) Dio [Koha virtual ldap] repozitorja http svn.rot13.org index.cgi virtual-ldap log bin ldap-rewrite.p...">LDAP rewrite</a>.</p>
<h1 id="koje_podatke_imamo_u_ldap_bazi">Koje podatke imamo u LDAP bazi?</h1>
<p>
ovo spada pod osnovne podatke:</p>
<p>
&nbsp;&nbsp;* uid - identifikator, korisnicko ime<br />
&nbsp;&nbsp;* hrEduPersonUniqueID - identifikator, <a href="mailto:uid@ffzg.hr">uid@ffzg.hr</a><br />
&nbsp;&nbsp;* cn - ime i prezime<br />
&nbsp;&nbsp;* sn - prezime<br />
&nbsp;&nbsp;* givenName - ime<br />
&nbsp;&nbsp;* mail<br />
&nbsp;&nbsp;* hrEduPersonUniqueNumber - JMBG, JMBAG, LOCAL_NO, PASSPORT_NO i slicni identifikatori..<br />
&nbsp;&nbsp;* hrEduPersonAffiliation - povezanost s ustanovom, moze biti vise povezanosti<br />
&nbsp;&nbsp;* hrEduPersonPrimaryAffiliation - temeljna povezanost<br />
&nbsp;&nbsp;* hrEduPersonExpireDate - datum istek temeljne povezanosti, odnosno korisnockog racuna</p>
<p>
&quot;Kada cu produzivati korisnicke racune, ja cu svim studentima<br />
kojima mogu, upisati JMBAG. Kasnije bi to bilo dobro prebaciti<br />
u OIB, koji se vec i spominje u raspravama :)&quot; (Došen)</p>
<h1 id="linkovi">Linkovi</h1>
<p>
<a href="https://saturn.ffzg.hr/koha/index.cgi?koha_virtual_ldap" title="(199 months) Za detalje pogledajte [LDAP] Virtualni LDAP omogućava Kohi da isporučuje podatke preko LDAP-a drugim...">Koha virtual LDAP</a>, <a href="https://saturn.ffzg.hr/koha/index.cgi?ldap_rewrite" title="(200 months) Dio [Koha virtual ldap] repozitorja http svn.rot13.org index.cgi virtual-ldap log bin ldap-rewrite.p...">LDAP rewrite</a></p>
<ul>
<li>Koha wiki: <a target="_blank" title="(external link)" href="http://wiki.koha.org/doku.php?id=en:development:ldap&amp;s=ldap">http://wiki.koha.org/doku.php?id=en:development:ldap&amp;s=ldap</a></li>
<li><a target="_blank" title="(external link)" href="http://lists.katipo.co.nz/public/koha/2005/009427.html">http://lists.katipo.co.nz/public/koha/2005/009427.html</a></li>
<li><a target="_blank" title="(external link)" href="http://blog.rot13.org/2009/03/virtual_ldap_rewrite_or_augment_data_on_the_fly.html">LDAP proxy napisan sa obogaćivanje podataka iz LDAP-a prije nego što dođu do Kohe<!-- wiki-renamed-hyperlink "LDAP proxy napisan sa obogaćivanje podataka iz LDAP=-a prije nego što dođu do Kohe"<http://blog.rot13.org/2009/03/virtual_ldap_rewrite_or_augment_data_on_the_fly.html> --></a></li>
</ul>
</div>
<hr/><div>Attachments: hulk-Virtual-LDAP.odp, koha-ldap-bind-as-user.diff, koha-ldap-keep-cardnumber.diff</div>]]></description>
<author>Dobrica Pavlinu&#x161;i&#x107;</author>
<category>for:dpavlin, korisnici, ldap</category>
<guid isPermaLink="true">https://saturn.ffzg.hr/koha/index.cgi?ldap</guid>
<pubDate>Fri, 26 Feb 2010 17:30:20 -0000</pubDate>
</item>
<item>
<title><![CDATA[Koha LDAP config]]></title>
<link>https://saturn.ffzg.hr/koha/index.cgi?koha_ldap_config</link>
<description><![CDATA[<div>Creator: Dobrica Pavlinušić</div><hr/><div>Tags: for:dpavlin, ldap</div><hr/><div class="wiki">
<h1 id="provjeriti_verziju">Provjeriti verziju</h1>
<pre>
dpavlin@koha-dev:/srv/koha$ grep VERSION /srv/koha/C4/Auth_with_ldap.pm 
use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS $debug);
        $VERSION = 3.10;        # set the version for version checking
</pre>
<br /><h1 id="etc_koha_koha_conf_xml">/etc/koha/koha-conf.xml</h1>
<pre>
&lt;ldapserver id=&quot;ldapserver&quot; listenref=&quot;ldapserver&quot;&gt;
&lt;!--
 &lt;hostname&gt;ldaps://ldap.ffzg.hr&lt;/hostname&gt;
--&gt;
 &lt;hostname&gt;ldap://localhost:1389&lt;/hostname&gt;
 &lt;base&gt;dc=ffzg,dc=hr&lt;/base&gt;

 &lt;replicate&gt;1&lt;/replicate&gt;  &lt;!-- add new users from LDAP to Koha database --&gt;
 &lt;update&gt;0&lt;/update&gt;        &lt;!-- update existing users in Koha database --&gt;

 &lt;auth_by_bind&gt;1&lt;/auth_by_bind&gt;
 &lt;principal_name&gt;%s&lt;/principal_name&gt; &lt;!-- optional, for auth_by_bind: a printf format to make userPrincipalName from koha userid --&gt;

 &lt;mapping&gt;            &lt;!-- match koha SQL field names to your LDAP record field names --&gt;
    &lt;firstname   is=&quot;givenname&quot;     &gt;&lt;/firstname&gt;
    &lt;surname     is=&quot;sn&quot;            &gt;&lt;/surname&gt;
    &lt;address     is=&quot;ffzg-ml_postanska_adresa_0&quot; &gt;&lt;/address&gt;
&lt;!--
    &lt;city        is=&quot;ffzg-prebivaliste_mjesto&quot; &gt;&lt;/city&gt;
--&gt;
    &lt;city        is=&quot;ffzg-ml_postanska_adresa_1&quot; &gt;&lt;/city&gt;
    &lt;zipcode     is=&quot;ffzg-prebivaliste_postanski_broj&quot;&gt;&lt;/zipcode&gt;

    &lt;branchcode  is=&quot;local-branch&quot;        &gt;FFZG&lt;/branchcode&gt;
    &lt;userid      is=&quot;hredupersonuniqueid&quot;  &gt;&lt;/userid&gt;
    &lt;password    is=&quot;userpassword&quot;  &gt;&lt;/password&gt;
    &lt;email       is=&quot;mail&quot;          &gt;&lt;/email&gt;
    &lt;categorycode is=&quot;local-categorycode&quot;  &gt;IMP&lt;/categorycode&gt;

    &lt;dateofbirth is=&quot;ffzg-datum_rodjenja&quot; &gt;&lt;/dateofbirth&gt;
    &lt;sex is=&quot;ffzg-spol&quot; &gt;&lt;/sex&gt;
    &lt;phone is=&quot;ffzg-ml_telefoni_fixed&quot;&gt;&lt;/phone&gt;
    &lt;mobile is=&quot;ffzg-ml_telefoni_mobile&quot;&gt;&lt;/mobile&gt;

 &lt;/mapping&gt;
&lt;/ldapserver&gt;
</pre>
<br /><p>
Koristi <a href="https://saturn.ffzg.hr/koha/index.cgi?ldap_rewrite" title="(200 months) Dio [Koha virtual ldap] repozitorja http svn.rot13.org index.cgi virtual-ldap log bin ldap-rewrite.p...">LDAP rewrite</a></p>
<p>
Da bi sve radilo potrebno je ugasiti <tt>ExtendedPatronAttributes</tt> na <a target="_blank" title="(external link)" href="https://10.60.0.252:8443/cgi-bin/koha/admin/preferences.pl?tab=patrons">https://10.60.0.252:8443/cgi-bin/koha/admin/preferences.pl?tab=patrons</a></p>
</div>
]]></description>
<author>Dobrica Pavlinu&#x161;i&#x107;</author>
<category>for:dpavlin, ldap</category>
<guid isPermaLink="true">https://saturn.ffzg.hr/koha/index.cgi?koha_ldap_config</guid>
<pubDate>Wed, 17 Feb 2010 12:37:32 -0000</pubDate>
</item>
<item>
<title><![CDATA[Koha virtual LDAP]]></title>
<link>https://saturn.ffzg.hr/koha/index.cgi?koha_virtual_ldap</link>
<description><![CDATA[<div>Creator: Dobrica Pavlinušić</div><hr/><div>Tags: for:dpavlin, ldap, sysadmin</div><hr/><div class="wiki">
<p>
Za detalje pogledajte <a href="https://saturn.ffzg.hr/koha/index.cgi?ldap" title="(198 months) Kako podesiti Kohu da radi s LDAP bazom Video prezentacije o Virtual LDAP-u http html5tv.rot13.org H...">LDAP</a></p>
<p>
Virtualni LDAP omogućava Kohi da isporučuje podatke preko LDAP-a drugim sustavima, u našem slučaju, kopirkama, vidi <a href="https://saturn.ffzg.hr/koha/index.cgi?safeq_integration" title="(204 months)  toc Integration of SafeQ and Koha We are trying to integrate users in SafeQ and our users in Koha. ...">SafeQ integration</a>.</p>
<p>
Drugi dio sustava je <a href="https://saturn.ffzg.hr/koha/index.cgi?ldap_rewrite" title="(200 months) Dio [Koha virtual ldap] repozitorja http svn.rot13.org index.cgi virtual-ldap log bin ldap-rewrite.p...">LDAP rewrite</a> koji omogućava korištenje <a href="mailto:login@ffzg.hr">login@ffzg.hr</a> bez modifikacija kohe.</p>
<div class="nlw_phrase"><table class="wafl_container">
  <tr>
    <td>
      <div class="wafl_box">
        
          <div class="wafl_titlebox">
            <div class="wafl_title">
              
                Contents: [KOHA]
              
            </div>
          </div>
          <div class="wafl_items">
            
              <div class="wiki">
<ul>
<li><span class="nlw_phrase"><a title="section link" href="https://saturn.ffzg.hr/koha/index.cgi?koha#upgrade">KOHA (upgrade)</a><!-- wiki: {link: [KOHA] upgrade} --></span></li>
<li><span class="nlw_phrase"><a title="section link" href="https://saturn.ffzg.hr/koha/index.cgi?koha#start_server_process">KOHA (start server process)</a><!-- wiki: {link: [KOHA] start server process} --></span></li>
</ul>
</div>

            
            
          </div>
        
      </div>
    </td>
  </tr>
</table>
<!-- wiki: {toc: }
--></div><br /><br /><h1 id="upgrade">upgrade</h1>
<p>
Upgrade na <strong>r61</strong> koji ima podršku za novu koha konfiguraciju i logine bez modifikacije kohe:</p>
<pre>
# tunnel
dpavlin@llin:~$ ssh -R 8022:localhost:22 10.60.0.252

dpavlin@koha-2010-01-06:~$ cd /srv/virtual-ldap/
dpavlin@koha-2010-01-06:/srv/virtual-ldap$ svn update
A    sql
A    sql/organizationalunit.sql
A    sql/group.sql
A    sql/hreduperson.sql
U    lib/LDAP/Virtual.pm
U    lib/LDAP/Koha.pm
U    bin/ldap-rewrite.pl
Updated to revision 61.
</pre>
<br /><h1 id="start_server_process">start server process</h1>
<pre>
dpavlin@koha-upgrade:~$ screen -S virtual-ldap
</pre>
<br /><p>
Pokrenuti server (inače to radi monit, ali on je deinstaliran da ne gnjavi)</p>
<pre>
dpavlin@koha-upgrade:~$ cd /srv/virtual-ldap/
dpavlin@koha-upgrade:/srv/virtual-ldap$ ./bin/virtual-ldap.pl 
LDAP server listening on port 1389
</pre>
<br /><p>
Čudan depdendency koji ne bi trebao postojati (kako radi na produkciji?)</p>
<pre>
dpavlin@koha-upgrade:/srv/virtual-ldap$ ./bin/virtual-ldap.pl 
Can't locate Net/LDAP/Server.pm in @INC (@INC contains: lib /etc/perl /usr/local/lib/perl/5.10.0 /usr/local/share/perl/5.10.0 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.10 /usr/share/perl/5.10 /usr/local/lib/site_perl .) at lib/LDAP/Virtual.pm line 12, &lt;DATA&gt; line 96.
BEGIN failed--compilation aborted at lib/LDAP/Virtual.pm line 12, &lt;DATA&gt; line 96.
Compilation failed in require at ./bin/virtual-ldap.pl line 7, &lt;DATA&gt; line 96.
BEGIN failed--compilation aborted at ./bin/virtual-ldap.pl line 7, &lt;DATA&gt; line 96.


dpavlin@koha-upgrade:/srv/virtual-ldap$ sudo apt-get install libnet-ldap-server-perl
</pre>
</div>
]]></description>
<author>Dobrica Pavlinu&#x161;i&#x107;</author>
<category>for:dpavlin, ldap, sysadmin</category>
<guid isPermaLink="true">https://saturn.ffzg.hr/koha/index.cgi?koha_virtual_ldap</guid>
<pubDate>Fri, 08 Jan 2010 19:08:08 -0000</pubDate>
</item>
<item>
<title><![CDATA[LDAP rewrite]]></title>
<link>https://saturn.ffzg.hr/koha/index.cgi?ldap_rewrite</link>
<description><![CDATA[<div>Creator: Dobrica Pavlinušić</div><hr/><div>Tags: for:dpavlin, ldap</div><hr/><div class="wiki">
<p>
Dio <a href="https://saturn.ffzg.hr/koha/index.cgi?koha_virtual_ldap" title="(199 months) Za detalje pogledajte [LDAP] Virtualni LDAP omogućava Kohi da isporučuje podatke preko LDAP-a drugim...">Koha virtual ldap</a> repozitorja:</p>
<p>
<a target="_blank" title="(external link)" href="http://svn.rot13.org/index.cgi/virtual-ldap/log/bin/ldap-rewrite.pl">http://svn.rot13.org/index.cgi/virtual-ldap/log/bin/ldap-rewrite.pl</a></p>
<div class="nlw_phrase"><table class="wafl_container">
  <tr>
    <td>
      <div class="wafl_box">
        
          <div class="wafl_titlebox">
            <div class="wafl_title">
              
                Contents: [KOHA]
              
            </div>
          </div>
          <div class="wafl_items">
            
              <div class="wiki">
<ul>
<li><span class="nlw_phrase"><a title="section link" href="https://saturn.ffzg.hr/koha/index.cgi?koha#features">KOHA (features)</a><!-- wiki: {link: [KOHA] features} --></span></li>
<li><span class="nlw_phrase"><a title="section link" href="https://saturn.ffzg.hr/koha/index.cgi?koha#start">KOHA (start)</a><!-- wiki: {link: [KOHA] start} --></span></li>
<li><span class="nlw_phrase"><a title="section link" href="https://saturn.ffzg.hr/koha/index.cgi?koha#changes">KOHA (changes)</a><!-- wiki: {link: [KOHA] changes} --></span></li>
</ul>
</div>

            
            
          </div>
        
      </div>
    </td>
  </tr>
</table>
<!-- wiki: {toc: }
--></div><br /><br /><h1 id="features">features</h1>
<ul>
<li>rewrite LDAP bind request cn: <a href="mailto:username@domain.com">username@domain.com</a> -&gt; uid=username,dc=domain,dc=com</li>
<li>rewrite search responses:</li>

<ul>
<li>expand key:value pairs from hrEduPersonUniqueNumber into hrEduPersonUniqueNumber_key</li>
<li>augment response with yaml/dn.yaml data (for external data import)</li>
</ul></ul>
<h1 id="start">start</h1>
<pre>
dpavlin@koha-upgrade:/srv/virtual-ldap$ ./bin/ldap-rewrite.pl 
# config = {
  &quot;listen&quot;       =&gt; &quot;localhost:1389&quot;,
  log_file       =&gt; &quot;log&quot;,
  overlay_prefix =&gt; &quot;ffzg-&quot;,
  upstream_ldap  =&gt; &quot;ldap.ffzg.hr&quot;,
  upstream_ssl   =&gt; 1,
  yaml_dir       =&gt; &quot;./yaml/&quot;,
} at ./bin/ldap-rewrite.pl line 59.
</pre>
<br /><h1 id="changes">changes</h1>
<div class="nlw_phrase"><div class="fetchrss_box">
  <div class="fetchrss_titlebox">
    
 <div class="fetchrss_title">
     fetchrss: http://svn.rot13.org/index.cgi/virtual-ldap/rss/bin/ldap-rewrite.pl
 </div>

  </div>
  
<ul class="fetchrss_item">
  <li class="fetchrss_item">
    There was an error: 404 Not Found

  </li>
</ul>

</div>
















<!-- wiki: {fetchrss: http://svn.rot13.org/index.cgi/virtual-=ldap/rss/bin/ldap-=rewrite.pl}
--></div><br /></div>
]]></description>
<author>Dobrica Pavlinu&#x161;i&#x107;</author>
<category>for:dpavlin, ldap</category>
<guid isPermaLink="true">https://saturn.ffzg.hr/koha/index.cgi?ldap_rewrite</guid>
<pubDate>Sun, 13 Dec 2009 17:15:13 -0000</pubDate>
</item>
<item>
<title><![CDATA[SafeQ integration]]></title>
<link>https://saturn.ffzg.hr/koha/index.cgi?safeq_integration</link>
<description><![CDATA[<div>Creator: Dobrica Pavlinušić</div><hr/><div>Tags: for:dpavlin, fotokopirke, ldap, SafeQ</div><hr/><div class="wiki">
<div class="nlw_phrase"><table class="wafl_container">
  <tr>
    <td>
      <div class="wafl_box">
        
          <div class="wafl_titlebox">
            <div class="wafl_title">
              
                Contents: [KOHA]
              
            </div>
          </div>
          <div class="wafl_items">
            
              <div class="wiki">
<ul>
<li><span class="nlw_phrase"><a title="section link" href="https://saturn.ffzg.hr/koha/index.cgi?koha#integration_of_safeq_and_koha">KOHA (Integration of SafeQ and Koha)</a><!-- wiki: {link: [KOHA] Integration of SafeQ and Koha} --></span></li>
<li><span class="nlw_phrase"><a title="section link" href="https://saturn.ffzg.hr/koha/index.cgi?koha#mapping_configuration">KOHA (Mapping configuration)</a><!-- wiki: {link: [KOHA] Mapping configuration} --></span></li>

<ul>
<li><span class="nlw_phrase"><a title="section link" href="https://saturn.ffzg.hr/koha/index.cgi?koha#users">KOHA (Users)</a><!-- wiki: {link: [KOHA] Users} --></span></li>
<li><span class="nlw_phrase"><a title="section link" href="https://saturn.ffzg.hr/koha/index.cgi?koha#roles">KOHA (Roles)</a><!-- wiki: {link: [KOHA] Roles} --></span></li>
<li><span class="nlw_phrase"><a title="section link" href="https://saturn.ffzg.hr/koha/index.cgi?koha#const_centre">KOHA (Const centre)</a><!-- wiki: {link: [KOHA] Const centre} --></span></li>
</ul>
<li><span class="nlw_phrase"><a title="section link" href="https://saturn.ffzg.hr/koha/index.cgi?koha#possible_bugs_in_safeq">KOHA (Possible bugs in SafeQ)</a><!-- wiki: {link: [KOHA] Possible bugs in SafeQ} --></span></li>

<ul>
<li><span class="nlw_phrase"><a title="section link" href="https://saturn.ffzg.hr/koha/index.cgi?koha#ldap_search">KOHA (LDAP search)</a><!-- wiki: {link: [KOHA] LDAP search} --></span></li>
<li><span class="nlw_phrase"><a title="section link" href="https://saturn.ffzg.hr/koha/index.cgi?koha#role_cost_centere_drop_down">KOHA (Role/Cost Centere drop-down)</a><!-- wiki: {link: [KOHA] Role/Cost Centere drop-=down} --></span></li>
</ul></ul>
</div>

            
            
          </div>
        
      </div>
    </td>
  </tr>
</table>
<!-- wiki: {toc: }
--></div><br /><br /><h1 id="integration_of_safeq_and_koha">Integration of SafeQ and Koha</h1>
<p>
We are trying to integrate users in SafeQ and our users in Koha. Koha is library system which stores it's users into relational database. To allow SafeQ system access to users we decided to implement LDAP protocol on top of our data scheme in Koha.</p>
<p>
This is described in little more details at: <a target="_blank" title="(external link)" href="http://blog.rot13.org/2009/03/integrating_systems_using_netldapserver_and_rdbms.html">http://blog.rot13.org/2009/03/integrating_systems_using_netldapserver_and_rdbms.html</a></p>
<h1 id="mapping_configuration">Mapping configuration</h1>
<h2 id="users">Users</h2>
<p>
Examining <span class="nlw_phrase"><a href="https://saturn.ffzg.hr/koha/index.cgi/UMgr-LDAP.conf?action=attachments_download;page_name=safeq_integration;id=20090429101357-0-14108">UMgr-LDAP.conf</a><!-- wiki: {file: UMgr-=LDAP.conf} --></span> configuration we came up with following mapping from our RDBMS to LDAP schema: <a target="_blank" title="(external link)" href="http://svn.rot13.org/index.cgi/virtual-ldap/view/sql/hreduperson.sql">http://svn.rot13.org/index.cgi/virtual-ldap/view/sql/hreduperson.sql</a></p>
<p>
we are creating objectGUID with primary key in our database and rest of the fields should be self-explanatory.</p>
<p>
This produce following result for LDAP search query:</p>
<pre>
dpavlin@koha-dev:/srv/virtual-ldap$ ldapsearch -h 10.60.0.13 -p 2389 -b dc=ffzg,dc=hr -x 'pager=E00401001F77965C'
# extended LDIF
#
# LDAPv3
# base &lt;dc=ffzg,dc=hr&gt; with scope subtree
# filter: pager=E00401001F77965C
# requesting: ALL
#

# dpavlin@ffzg.hr, SURAD, ffzg.hr
dn: uid=dpavlin@ffzg.hr,ou=SURAD,dc=ffzg,dc=hr
ou: SURAD
uid: dpavlin@ffzg.hr
objectGUID: 606
cn:: RG9icmljYSBQYXZsaW51xaFpxIc=
homeDirectory: /home/606
objectClass: person
objectClass: organizationalPerson
objectClass: inetOrgPerson
objectClass: hrEduPerson
memberOf: SURAD
sn:: UGF2bGludcWhacSH
mail: dpavlin@rot13.org
pager: E00401001F77965C
givenName: Dobrica
displayName:: UGF2bGludcWhacSH

# search result
search: 2
result: 0 Success

# numResponses: 2
# numEntries: 1
</pre>
<br /><p>
This works quite well, and I can see users with their's cards in SafeQ system.</p>
<span class="nlw_phrase"><img alt="search-uid.png" src="https://saturn.ffzg.hr/koha/index.cgi/search-uid.png?action=attachments_download;page_name=safeq_integration;id=20090429100247-0-28187" /><!-- wiki: {image: search-=uid.png} --></span><br /><br /><h2 id="roles">Roles</h2>
<p>
Roles are mapped into groups using following mapping: <a target="_blank" title="(external link)" href="http://svn.rot13.org/index.cgi/virtual-ldap/view/sql/group.sql">http://svn.rot13.org/index.cgi/virtual-ldap/view/sql/group.sql</a></p>
<p>
Which generate LDAP groups like this:</p>
<pre>
dn:cn=SURAD,ou=SURAD,dc=ffzg,dc=hr

    members: uid=vivainfo,ou=SURAD,dc=ffzg,dc=hr
             uid=dpavlin,ou=SURAD,dc=ffzg,dc=hr
         ou: SURAD
         cn: SURAD
description: Suradnici
objectClass: group
</pre>
<br /><p>
which produce groups in Role drop down:</p>
<span class="nlw_phrase"><img alt="group-role.png" src="https://saturn.ffzg.hr/koha/index.cgi/group-role.png?action=attachments_download;page_name=safeq_integration;id=20090429100613-0-32182" /><!-- wiki: {image: group-=role.png} --></span><br /><br /><p>
Some more information about defining groups in ldap can be found at: <a target="_blank" title="(external link)" href="http://blog.rot13.org/2009/04/ldap_haters_guide_to_groups.html">http://blog.rot13.org/2009/04/ldap_haters_guide_to_groups.html</a></p>
<h2 id="const_centre">Const centre</h2>
<p>
Groups which we have defined in Koha are really only useful for reporting, so it seems that cost centres in SafeQ are the right place to import our groups.</p>
<p>
We are trying to use following mapping: <a target="_blank" title="(external link)" href="http://svn.rot13.org/index.cgi/virtual-ldap/view/sql/organizationalunit.sql">http://svn.rot13.org/index.cgi/virtual-ldap/view/sql/organizationalunit.sql</a></p>
<p>
Idea is to expose same group data as organizationalUnits in SafeQ so we can get accounting by those groups. We would also like to have different prices for each group of users and ability to report using groups from Koha.</p>
<p>
Changing configration to:</p>
<pre>
# Mapping of LDAP containers to SafeQ cost centres (departments)
# If enabled, all organisational units containers will be displayed in SafeQ as cost centres
# If disabled (no, false), attribute mapping is used - see ldap_ou
ldap_map_ou = yes
</pre>
<br /><p>
We get const centers mapped from our organizational units:</p>
<span class="nlw_phrase"><img alt="const-center.png" src="https://saturn.ffzg.hr/koha/index.cgi/const-center.png?action=attachments_download;page_name=safeq_integration;id=20090429115227-1-14108" /><!-- wiki: {image: const-=center.png} --></span><br /><br /><p>
<strong>but all const centres have same number (0)</strong></p>
<blockquote>
How can we supply SafeQ with correct cost center number so users can end up in correct one?</blockquote>
<br /><h1 id="possible_bugs_in_safeq">Possible bugs in SafeQ</h1>
<h2 id="ldap_search">LDAP search</h2>
<p>
I also found out something which seems like a bug in the way SafeQ search LDAP server: when you search for 'dpavlin' as login/alias I get following queries:</p>
<pre>
## filter and [

 { equalityMatch =&gt; { assertionValue =&gt; &quot;HrEduPerson&quot;, attributeDesc =&gt; &quot;objectclass&quot; }, },
 { equalityMatch =&gt; { assertionValue =&gt; &quot;dpavlin%&quot;, attributeDesc =&gt; &quot;uid&quot; }, },
]
</pre>
<br /><p>
objectclass is o.k., but uid looks like <tt>uid=dpavlin%</tt> which I <strong>think</strong> it should be <tt>uid=dpavlin*</tt> to be correct LDAP syntax.</p>
<p>
This query doesn't return anything, but next one is o.k.:</p>
<pre>
## filter and [

 { equalityMatch =&gt; { assertionValue =&gt; &quot;HrEduPerson&quot;, attributeDesc =&gt; &quot;objectclass&quot; }, },
 { substrings =&gt; { substrings =&gt; [{ any =&gt; &quot;dpavlin&quot; }], type =&gt; &quot;uid&quot; }, },
]
</pre>
<br /><p>
which is <tt>uid=*dpavlin*</tt> and it finds user.</p>
<h2 id="role_cost_centere_drop_down">Role/Cost Centere drop-down</h2>
<p>
Selecting role of const center doesn't change filtered output of users. I don't see any difference in LDAP search query when changing selected role and/or cost centar. Is that normal?</p>
</div>
<hr/><div>Attachments: const-center.png, group-role.png, search-uid.png, UMgr-LDAP.conf</div>]]></description>
<author>Dobrica Pavlinu&#x161;i&#x107;</author>
<category>for:dpavlin, fotokopirke, ldap, SafeQ</category>
<guid isPermaLink="true">https://saturn.ffzg.hr/koha/index.cgi?safeq_integration</guid>
<pubDate>Wed, 02 Sep 2009 17:21:16 -0000</pubDate>
</item>
</channel>
</rss>