grullas pass
This commit is contained in:
@@ -10,6 +10,15 @@ use Dojo::Conf;
|
||||
|
||||
sub new { bless {}, shift }
|
||||
|
||||
sub grulla_pass{
|
||||
return
|
||||
_read( "select pass as gpass from usuario where nombre like 'grullas'")->[0]
|
||||
};
|
||||
sub ugrulla_pass{
|
||||
my($c,$p)=@_;
|
||||
_write("update usuario set pass= ? where nombre like 'grullas'",$p);
|
||||
}
|
||||
|
||||
sub check {
|
||||
my ($self, $user, $pass) = @_;
|
||||
my $q="select permiso_id as pid from usuario where nombre = ? and pass=? ";
|
||||
@@ -35,5 +44,16 @@ sub _read{
|
||||
}
|
||||
|
||||
|
||||
sub _write{
|
||||
my ($q,@bind)=@_;
|
||||
my (@empty);
|
||||
my $dbh = DBI->connect("DBI:mysql:".Dojo::Conf::GRULLADB.":".Dojo::Conf::GRULLADB_H,Dojo::Conf::GRULLADB_UW,Dojo::Conf::GRULLADB_UWP);
|
||||
return 0 unless($dbh);
|
||||
my $h=$dbh->do($q,{ Slice => {} },@bind);
|
||||
$dbh->disconnect();
|
||||
# log("db write:". $h );
|
||||
return $h;
|
||||
}
|
||||
|
||||
|
||||
1;
|
||||
|
||||
Reference in New Issue
Block a user