grullas pass

This commit is contained in:
mynah
2018-07-27 17:41:31 -05:00
parent 6811b19471
commit c2be824f0f
3 changed files with 26 additions and 18 deletions

View File

@@ -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;

View File

@@ -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;

View File

@@ -1,8 +1,8 @@
<section class="title flex">
<article class="title"> <p>Radio</p> </article>
<article class="bcast"> <form action="/admin/radio" method"POST">
<article class="bcast"> <form action="/admin/radio" method="post">
<div><label>Contraseña Video Stream</label></div>
<div><textarea name="link" id="gpass" class="gpass"><<%= %gpass %></textarea></div>
<div><textarea name="gpass" id="gpass" class="gpass"><%= $gpass %></textarea></div>
<input type="hidden" name="update" value="gpass">
<div><input type="submit" name="pup" value="Cambiar"></div>
@@ -19,7 +19,7 @@
</article>
<article class="rmod">
<form action="/admin/radio" method="POST">
<form action="/admin/radio" method="post">
<label>Aviso para el radio</label>
<textarea name="link" id="tmod" class="rmod"><%= $rmod %></textarea> <!-- a#dropvar -->
<input type="hidden" name="update" value="rmod"> <!-- a#dropvar -->