Commit 7e9c0884 authored by Xavier Guimard's avatar Xavier Guimard

Remove unused sub (#LEMONLDAP-595)

git-svn-id: svn://svn.forge.objectweb.org/svnroot/lemonldap/branches/lemonldap-ng_version_1_4-bugfixes@5050 1dbb9719-a921-0410-b57f-c3a383c2c641
parent f93c464a
......@@ -118,47 +118,5 @@ sub setGroups {
PE_OK;
}
## @method boolean setUserDBValue(string key, string value)
# Store a value in UserDB
# @param key Key in user information
# @param value Value to store
# @return result
sub setUserDBValue {
my ( $self, $key, $value ) = splice @_;
# Mandatory attributes
return 0 unless defined $key;
# Write in database
$self->lmLog( "Replace $key attribute in database with value $value",
'debug' );
# Connect
my $dbh =
$self->dbh( $self->{dbiUserChain}, $self->{dbiUserUser},
$self->{dbiUserPassword} );
return 0 unless $dbh;
my $table = $self->{dbiUserTable};
my $pivot = $self->{userPivot};
my $user = $self->{user};
$user =~ s/'/''/g;
my $sth;
eval {
$sth = $dbh->prepare("UPDATE $table SET $key = $value WHERE $pivot=?");
$sth->execute($user);
};
# Check result
if ($@) {
$self->lmLog( "DBI error: $@", 'error' );
return 0;
}
return 1;
}
1;
......@@ -184,33 +184,6 @@ sub setGroups {
PE_OK;
}
## @method boolean setUserDBValue(string key, string value)
# Store a value in UserDB
# @param key Key in user information
# @param value Value to store
# @return result
sub setUserDBValue {
my ( $self, $key, $value ) = splice @_;
# Mandatory attributes
return 0 unless defined $key;
# Write in LDAP
$self->lmLog( "Replace $key attribute in LDAP with value $value", 'debug' );
my $modification =
$self->{ldap}->modify( $self->{dn}, replace => { $key => $value } );
# Check result
if ( $modification->code ) {
$self->lmLog(
"LDAP error " . $modification->code . ": " . $modification->error,
'error' );
return 0;
}
return 1;
}
## @apmethod int userDBFinish()
# Unbind.
# @return Lemonldap::NG::Portal constant
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment