diff --git a/lib/Dojo/Controller/Home.pm b/lib/Dojo/Controller/Home.pm index 99d226a..b85ce28 100644 --- a/lib/Dojo/Controller/Home.pm +++ b/lib/Dojo/Controller/Home.pm @@ -145,8 +145,11 @@ sub tst{ my $c=shift; $c->dbv->umod($c->param('link'),'rmod') if (($c->param("hup") // " " )=~/Cambiar/); + $c->dbg->ugrulla_pass($c->param('gpass')) + if (($c->param("pup") // " " )=~/Cambiar/); $c->stash($c->dbv->mod); $c->stash($c->dbv->conf_radio); + $c->stash($c->dbg->grulla_pass); $c->stash( merge_hash( (load_module("home/admin/radio"))[0], (load_module("home/admin/candySwitch"))[0], @@ -224,21 +227,6 @@ sub tst{ } - # if (($c->param("id") // " " ) eq "0") { - # $c->dbv->eup if (($c->param("eup") // " " ) =~/Aceptar/); - # $c->dbv->cup if (($c->param("cup") // " " ) =~/Aceptar/); - # $c->dbv->pup if (($c->param("pup") // " " ) =~/Aceptar/); - # } - # else{ - # if (($c->param("cup") // " " )=~/Aceptar/){ $c->dbv->cch; } - # elsif (($c->param("eup") // " " )=~/Aceptar/){ $c->dbv->ech; } - # elsif (($c->param("pup") // " " )=~/Aceptar/){ $c->dbv->pch; } - # elsif (($c->param("edel") // " " )=~/Eliminar/){ $c->dbv->edel; } - # elsif (($c->param("cdel") // " " )=~/Eliminar/){ $c->dbv->cdel; } - # elsif (($c->param("pdel") // " " )=~/Eliminar/){ $c->dbv->pdel; } - #}}; - #} - #} #============================================================================== 1; diff --git a/lib/Dojo/Model/Users.pm b/lib/Dojo/Model/Users.pm index 47db6d3..bd89c88 100644 --- a/lib/Dojo/Model/Users.pm +++ b/lib/Dojo/Model/Users.pm @@ -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; diff --git a/templates/home/admin/radio.html.ep b/templates/home/admin/radio.html.ep index fabcf67..70ededd 100755 --- a/templates/home/admin/radio.html.ep +++ b/templates/home/admin/radio.html.ep @@ -1,8 +1,8 @@

Radio

-
+
-
+
@@ -19,7 +19,7 @@
- +