Skip to content

Commit

Permalink
[Patch] Renaming ldap cache tables | Moving db tune up script to utils
Browse files Browse the repository at this point in the history
* LDAP Cache database tables names have been modified to include the
prefix cernbox_

* db_tuneup.sql script has been moved to cernbox_utils folder
  • Loading branch information
nadir committed Apr 4, 2016
1 parent 8251444 commit 2d333a8
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 40 deletions.
File renamed without changes.
38 changes: 4 additions & 34 deletions db_structure.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1270,7 +1270,7 @@
</table>

<table>
<name>ldap_users</name>
<name>cernbox_ldap_users</name>
<declaration>
<field>
<name>cn</name>
Expand Down Expand Up @@ -1318,7 +1318,7 @@
</table>

<table>
<name>ldap_groups</name>
<name>cernbox_ldap_groups</name>
<declaration>
<field>
<name>cn</name>
Expand All @@ -1339,38 +1339,7 @@
</table>

<table>
<name>ldap_group_members</name>
<declaration>
<field>
<name>user_cn</name>
<type>text</type>
<default></default>
<notnull>true</notnull>
<length>50</length>
</field>
<field>
<name>group_cn</name>
<type>text</type>
<default></default>
<notnull>true</notnull>
<length>100</length>
</field>
<index>
<primary>true</primary>
<unique>true</unique>
<name>group_members_index</name>
<field>
<name>user_cn</name>
</field>
<field>
<name>group_cn</name>
</field>
</index>
</declaration>
</table>

<table>
<name>ldap_group_members</name>
<name>cernbox_ldap_group_members</name>
<declaration>
<field>
<name>user_cn</name>
Expand Down Expand Up @@ -1399,4 +1368,5 @@
</index>
</declaration>
</table>

</database>
6 changes: 3 additions & 3 deletions lib/ldapupdatecron.php
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ function insertIntoDatabase($table, $sql, $useLoadData = false)

//cronlog('Inserting groups into database...');

insertIntoDatabase('ldap_groups', buildQuery('ldap_groups', 's', ['cn'], $ldapGroups));
insertIntoDatabase('cernbox_ldap_groups', buildQuery('cernbox_ldap_groups', 's', ['cn'], $ldapGroups));
unset($ldapGroups);

//cronlog('Done');
Expand Down Expand Up @@ -281,13 +281,13 @@ function insertIntoDatabase($table, $sql, $useLoadData = false)

//cronlog('Inserting users into database...');

insertIntoDatabase('ldap_users', buildQuery('ldap_users', 'siss', ['cn','uidnumber','displayname','employeetype'], $ldapUsers));
insertIntoDatabase('cernbox_ldap_users', buildQuery('cernbox_ldap_users', 'siss', ['cn','uidnumber','displayname','employeetype'], $ldapUsers));
unset($ldapUsers);

//cronlog('Done');
//cronlog('Inserting users <-> groups into database...');

insertIntoDatabase('ldap_group_members', buildCVSFile('ss', ['user_cn','group_cn'], $userGroups), true);
insertIntoDatabase('cernbox_ldap_group_members', buildCVSFile('ss', ['user_cn','group_cn'], $userGroups), true);
unset($userGroups);

cronlog('Done');
Expand Down
6 changes: 3 additions & 3 deletions lib/private/cache/ldapdatabase.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@

class LDAPDatabase
{
const GROUPS_TABLE = 'ldap_groups';
const USERS_TABLE = 'ldap_users';
const GROUP_MAPPINGS = 'ldap_group_members';
const GROUPS_TABLE = 'cernbox_ldap_groups';
const USERS_TABLE = 'cernbox_ldap_users';
const GROUP_MAPPINGS = 'cernbox_ldap_group_members';

/**
*
Expand Down

0 comments on commit 2d333a8

Please sign in to comment.