Пример #1
0
 public static function get_actualizaciones_usuario($offset = 0)
 {
     global $ari;
     $return = array();
     $i = 0;
     $limit = 20;
     if (!oob_validatetext::isNumeric($offset)) {
         $offset = 0;
     }
     $perfil = perfil_perfil::existe_usuario($ari->user);
     $perfil = $ari->db->qMagic($perfil[0]->id());
     if ($datos = static::getList((int) $offset, (int) $limit, 'fecha', 'DESC', false, false, false, "AND id_perfil = {$perfil}")) {
         foreach ($datos as $d) {
             $return[$i]['id'] = $d->id();
             $return[$i]['mensaje'] = $d->get('mensaje');
             $return[$i]['foto'] = $d->foto();
             $return[$i]['fecha'] = $d->get('fecha')->format("%d-%m-%Y");
             $i++;
         }
     }
     return $return;
 }
Пример #2
0
 public static function get_timeline(perfil_perfil $perfil, $offset = 0)
 {
     // buscamos todas las notificaciones que tengamos del tipo "perfil_mensaje", y mostramos los mensajes.
     global $ari;
     $limit = 20;
     $return = array();
     $i = 0;
     $filtro = array();
     $filtro[] = array('value' => $perfil->id(), 'field' => 'destino::id', 'type' => 'list');
     $filtro[] = array('value' => 3, 'field' => 'tipo', 'type' => 'list');
     if (!oob_validatetext::isNumeric($offset)) {
         $offset = 0;
     }
     if ($datos = static::getFilteredList((int) $offset, (int) $limit, 'fecha', 'DESC', $filtro)) {
         foreach ($datos as $d) {
             $return[$i]['mensaje'] = $d->get('origen')->interpretar_mensaje();
             $return[$i]['foto'] = $d->get('origen')->foto();
             $return[$i]['fecha'] = $d->get('origen')->get('fecha')->format("%d-%m-%Y");
             $i++;
         }
     }
     return $return;
 }
Пример #3
0
 */
include "..\\oob_validatetext.php";
$numero = "1.12";
$entero = "5";
$email = "*****@*****.**";
$largo = "123456789";
$corto = "123";
if (!oob_validatetext::isNumeric($numero)) {
    echo "NUMERIC NO";
} else {
    echo "NUMERIC OK<br>";
}
echo "<br>";
if (!oob_validatetext::isInt($entero)) {
    echo "INT NO INT";
} else {
    echo "INT OK<br>";
}
echo "<br>";
if (!oob_validatetext::isPassword($corto)) {
    echo "NO CLAVE";
} else {
    echo "SI CLAVE<br>";
}
echo "<br>";
if (!oob_validatetext::isPassword($largo)) {
    echo "NO CLAVE";
} else {
    echo "SI CLAVE<br>";
}
echo "<br>";
Пример #4
0
<?php

global $ari;
$ari->t->force_compile = true;
$ari->t->cache = false;
$ct = new OOB_cleantext();
$limit = 20;
if (!isset($_GET['pos']) || !oob_validatetext::isNumeric($_GET['pos'])) {
    $_GET['pos'] = 0;
}
// check user permissions
if (is_a($ari->user, 'oob_user')) {
    $usuario = $ari->user;
    // asignamos datos del usuario
    if ($perfil_existente = perfil_perfil::existe_usuario($ari->user)) {
        $perfil = $perfil_existente[0];
    }
} else {
    seguridad::requireLogin();
}
// mostramos los datos en la pantalla
$ari->t->assign("nombre", $perfil->name());
$ari->t->assign("telefono", $ct->dropHTML($perfil->get('telefono')));
$ari->t->assign("bio", $ct->dropHTML($perfil->get('bio')));
$ari->t->assign("url", $ct->dropHTML($perfil->get('url')));
$ari->t->assign("foto", $perfil->foto());
$ari->t->assign("mensajes", perfil_mensaje::get_actualizaciones_usuario($_GET['pos']));
$ari->t->assign("mensajes_count", perfil_mensaje::get_actualizaciones_usuario_count());
$ari->t->assign("limit", $limit);
$ari->t->display($ari->module->usertpldir() . DIRECTORY_SEPARATOR . "perfil_actualizaciones.tpl");
Пример #5
0
 public static function get_mis_amigos_bloque($limit)
 {
     global $ari;
     $return = array();
     $i = 0;
     if (!oob_validatetext::isNumeric($limit)) {
         $limit = 4 * 8 - 1;
     }
     $perfil = perfil_perfil::existe_usuario($ari->user);
     $perfil = $ari->db->qMagic($perfil[0]->id());
     if ($datos = static::getList(0, (int) $limit, 'fecha', 'ASC', false, false, false, "AND id_origen = {$perfil}")) {
         foreach ($datos as $d) {
             $return[$i]['perfil']['id'] = $d->get('destino')->id();
             $return[$i]['perfil']['nombre'] = $d->get('destino')->name();
             $return[$i]['perfil']['foto'] = $d->get('destino')->foto_miniatura();
             $i++;
         }
     }
     return $return;
 }
Пример #6
0
 }
 // usuario
 $usuario->set('email', $_POST['email']);
 if (isset($_POST['pass']) && isset($_POST['passtwo']) && ($_POST['pass'] != '' || $_POST['passtwo'] !== '')) {
     if ($_POST['pass'] === $_POST['passtwo']) {
         $usuario->set('password', $_POST['pass']);
     } else {
         $usuario->error()->addError("NO_CONCUERDAN");
     }
 }
 if (!isset($_POST['condiciones']) || $_POST['condiciones'] != 'checkbox') {
     $usuario->error()->addError("INVALID_CONDICIONES");
 }
 // perfil
 $perfil->set('nombre', $_POST['nombre']);
 $perfil->set('fecha_nacimiento', new Date($_POST['fecha_nacimiento_Year'] . '-' . oob_validatetext::addZero($_POST['fecha_nacimiento_Month']) . '-' . oob_validatetext::addZero($_POST['fecha_nacimiento_Day']) . ' 00:00:00'));
 $perfil->set('telefono', $_POST['telefono']);
 $perfil->set('bio', $_POST['bio']);
 $perfil->set('url', $_POST['url']);
 if ($usuario->store()) {
     if ($new_user) {
         $usuario->linkStandardGroup();
     }
     $perfil->set('usuario', $usuario);
     if ($perfil->store()) {
         if ($new_user) {
             // mandar mail de nuevo usuario
             $perfil->enviar_mail_perfil_nuevo();
             // si el usuario puede loguearse
             if ($validation == "no") {
                 oob_user::login($_POST['usuario'], $_POST['pass']);
Пример #7
0
$handle = $ari->url->getVars();
$es_amigo = true;
$limit = 20;
if (!isset($_GET['pos']) || !oob_validatetext::isNumeric($_GET['pos'])) {
    $_GET['pos'] = 0;
}
// perfil del usuario
// check user permissions
if (is_a($ari->user, 'oob_user')) {
    $usuario = $ari->user;
    // asignamos datos del usuario
    if ($perfil_existente = perfil_perfil::existe_usuario($ari->user)) {
        $perfil_usuario = $perfil_existente[0];
    }
}
if (!isset($handle[2]) || !oob_validatetext::isNumeric($handle[2])) {
    $perfil = $perfil_usuario;
} else {
    $perfil = new perfil_perfil($handle[2]);
}
// mostramos los datos en la pantalla
$ari->t->assign("nombre", $perfil->name());
$ari->t->assign("id_perfil", $perfil->id());
$ari->t->assign("telefono", $ct->dropHTML($perfil->get('telefono')));
$ari->t->assign("bio", $ct->dropHTML($perfil->get('bio')));
$ari->t->assign("url", $ct->dropHTML($perfil->get('url')));
$ari->t->assign("foto", $perfil->foto());
if (isset($perfil_usuario) && $perfil_usuario->id() != $perfil->id()) {
    if (!perfil_amigo::es_amigo($perfil_usuario, $perfil)) {
        $es_amigo = false;
    }