Exemplo n.º 1
0
 public function rating()
 {
     /*** JS File Only to Members. For its part, the Rating System will redirect the visitors who are not connected to the registration form. ***/
     if (UserCore::auth()) {
         $this->design->addJs(PH7_LAYOUT . PH7_SYS . PH7_MOD . $this->registry->module . PH7_SH . PH7_TPL . PH7_TPL_MOD_NAME . PH7_SH . PH7_JS, 'script.js');
     }
     /*** Meta Tags ***/
     /**
      * @internal We can include HTML tags in the title since the template will erase them before display.
      */
     $sMenDesc = t('You men!') . '<br />' . t('Vote for the most beautiful women, the sexiest and hottest online dating free site!');
     $sWomenDesc = t('You women!') . '<br />' . t('Vote for the best men, the sexiest and hottest free online dating site!');
     $this->view->page_title = t('Hot On Not - Free Online Dating Site');
     $this->view->meta_description = $sMenDesc . ' ' . $sWomenDesc;
     $this->view->meta_keywords = t('hot, hot or not, hotornot, sexy, rate, rating, voting, women, free, dating, speed dating, flirt');
     $this->view->desc_for_man = $sMenDesc;
     $this->view->desc_for_woman = $sWomenDesc;
     /*** Display ***/
     // If the user is connected, we do not display its own avarar since this user can not vote for himself.
     $iProfileId = UserCore::auth() ? $this->session->get('member_id') : null;
     $oData = $this->oHoNModel->getPicture($iProfileId);
     if (empty($oData)) {
         Framework\Http\Http::setHeadersByCode(404);
         $this->view->error = t('Sorry, We did not find the photo to Hot Or Not Party.');
     } else {
         $this->view->avatarDesign = new AvatarDesignCore();
         // Avatar Design Class
         $this->view->data = $oData;
     }
     $this->output();
 }
Exemplo n.º 2
0
 public function __construct()
 {
     parent::__construct();
     if (!UserCore::auth()) {
         $this->signUpRedirect();
     } elseif (!$this->checkMembership() || !$this->group->love_calculator) {
         $this->paymentRedirect();
     }
 }
Exemplo n.º 3
0
 public function __construct()
 {
     parent::__construct();
     if (!UserCore::auth() && $this->registry->controller !== 'AdminController') {
         $this->signUpRedirect();
     }
     if (!AdminCore::auth() && $this->registry->controller === 'AdminController') {
         // For security reasons, we do not redirectionnons the user to hide the url of the administrative part.
         Framework\Url\Header::redirect(Framework\Mvc\Router\Uri::get('payment', 'main', 'index'), $this->adminSignInMsg(), 'error');
     }
 }
Exemplo n.º 4
0
 public function __construct()
 {
     parent::__construct();
     // This module is available only to members
     if (!UserCore::auth() && !AdminCore::auth()) {
         $this->signInRedirect();
     }
     if (!AdminCore::auth() && $this->registry->controller === 'AdminController') {
         // For security reasons, we do not redirectionnons the user to hide the url of the administrative part.
         Framework\Url\Header::redirect(Framework\Mvc\Router\Uri::get('user', 'main', 'login'), $this->adminSignInMsg(), 'error');
     }
 }
 public function __construct()
 {
     parent::__construct();
     if (!UserCore::auth() && ($this->registry->action === 'addalbum' || $this->registry->action === 'addphoto' || $this->registry->action === 'editalbum' || $this->registry->action === 'editphoto' || $this->registry->action === 'deletephoto' || $this->registry->action === 'deletealbum')) {
         $this->signInRedirect();
     }
     if (!AdminCore::auth()) {
         if (!$this->checkMembership() || !$this->group->view_pictures) {
             $this->paymentRedirect();
         } elseif (($this->registry->action === 'addalbum' || $this->registry->action === 'addvideo') && !$this->group->upload_pictures) {
             $this->paymentRedirect();
         }
     }
 }
Exemplo n.º 6
0
 public function __construct()
 {
     parent::__construct();
     $bAdminAuth = AdminCore::auth();
     if (!UserCore::auth() && !$bAdminAuth && ($this->registry->action === 'add' || $this->registry->action === 'delete')) {
         $this->signInRedirect();
     }
     if (!$bAdminAuth) {
         if (!$this->checkMembership() || !$this->group->view_comments) {
             $this->paymentRedirect();
         } elseif ($this->registry->action === 'add' && !$this->group->write_comments) {
             $this->paymentRedirect();
         }
     }
 }
 public function __construct()
 {
     parent::__construct();
     $bAdminAuth = AdminCore::auth();
     if (!UserCore::auth() && !$bAdminAuth) {
         $this->signInRedirect();
     }
     if (!$bAdminAuth) {
         if (!$this->checkMembership() || $this->registry->action === 'inbox' && !$this->group->read_mails) {
             $this->paymentRedirect();
         } elseif ($this->registry->action === 'compose' && !$this->group->send_mails) {
             $this->paymentRedirect();
         }
     }
     if (!$bAdminAuth && $this->registry->controller === 'AdminController') {
         // For security reasons, we do not redirectionnons the user to hide the url of the administrative part.
         Framework\Url\Header::redirect(Framework\Mvc\Router\Uri::get('user', 'main', 'login'), $this->adminSignInMsg(), 'error');
     }
 }
Exemplo n.º 8
0
 public function __construct()
 {
     parent::__construct();
     // Level for Notes
     $bAdminAuth = AdminCore::auth();
     if (!UserCore::auth() && ($this->registry->action === 'add' || $this->registry->action === 'edit' || $this->registry->action === 'delete')) {
         $this->signUpRedirect();
     }
     if (!$bAdminAuth) {
         if (!$this->checkMembership() || $this->registry->action === 'read' && !$this->group->read_notes) {
             $this->paymentRedirect();
         } elseif ($this->registry->action === 'add' && !$this->group->write_notes) {
             $this->paymentRedirect();
         }
     }
     if (!$bAdminAuth && $this->registry->controller === 'AdminController') {
         // For security reasons, we do not redirectionnons the user to hide the url of the administrative part.
         Framework\Url\Header::redirect(Framework\Mvc\Router\Uri::get('blog', 'main', 'index'), $this->adminSignInMsg(), 'error');
     }
 }
Exemplo n.º 9
0
 public function __construct()
 {
     parent::__construct();
     /***** Levels for the forums *****/
     $bAdminAuth = AdminCore::auth();
     if (!UserCore::auth() && !$bAdminAuth && ($this->registry->action === 'addtopic' || $this->registry->action === 'edittopic' || $this->registry->action === 'deletetopic' || $this->registry->action === 'reply' || $this->registry->action === 'editmessage' || $this->registry->action === 'deletemessage')) {
         $this->signInRedirect();
     }
     if (!$bAdminAuth) {
         if (!$this->checkMembership() || !$this->group->forum_access) {
             $this->paymentRedirect();
         } elseif ($this->registry->action === 'addtopic' && !$this->group->create_forum_topics) {
             $this->paymentRedirect();
         } elseif ($this->registry->action === 'reply' && !$this->group->answer_forum_topics) {
             $this->paymentRedirect();
         }
     }
     if (!$bAdminAuth && $this->registry->controller === 'AdminController') {
         // For security reasons, we do not redirectionnons the user to hide the url of the administrative part.
         Framework\Url\Header::redirect(Framework\Mvc\Router\Uri::get('forum', 'forum', 'index'), $this->adminSignInMsg(), 'error');
     }
 }
Exemplo n.º 10
0
 public function index()
 {
     // Display home page of web site
     // We must not put the title as this is the home page, so this is the default title is used.
     /**** BEGIN Style sheet and JS files ****/
     // Only visitors
     if (!UserCore::auth()) {
         $this->view->is_splash_page = Framework\Mvc\Model\DbConfig::getSetting('splashPage');
         $this->design->addCss(PH7_LAYOUT . PH7_TPL . PH7_TPL_NAME . PH7_SH . PH7_CSS, 'splash.css,tooltip.css,js/jquery/carousel.css');
         $this->design->addJs(PH7_DOT, PH7_STATIC . PH7_JS . 'jquery/carouFredSel.js,' . PH7_LAYOUT . PH7_TPL . PH7_TPL_NAME . PH7_SH . PH7_JS . 'splash.js');
     }
     // Only Members
     if (UserCore::auth()) {
         $this->design->addCss(PH7_LAYOUT . PH7_TPL . PH7_TPL_NAME . PH7_SH . PH7_CSS, 'zoomer.css');
         $this->design->addJs(PH7_STATIC . PH7_JS, 'zoomer.js,Wall.js');
         $this->view->first_name = $this->session->get('member_first_name');
         // First Name for the welcome message.
     }
     /**** END Style sheet and JS files ****/
     // For Profiles Carousel
     $this->view->userDesignModel = new UserDesignCoreModel();
     $this->view->userDesign = new UserDesignCore();
     $this->output();
 }
Exemplo n.º 11
0
function processAllEmails($mailbox, $emails, $rucReceptor)
{
    $returnArray = array("status" => true, "html" => "");
    $handlerUserCore = new UserCore();
    rsort($emails);
    $returnArray["html"] .= '   <table class="table table-condensed table-striped">
                                    <thead>
                                        <tr>
                                            <th>ID</th>
                                            <th>Remitente</th>
                                            <th>Fecha</th>
                                            <th>Docs.</th>
                                            <th>Estado</th>
                                            <th>Proc.</th>
                                        </tr>
                                    </thead>
                                    <tbody>';
    foreach ($emails as $email_number) {
        $status = '';
        // Traer datos generales de e-mail
        $overview = imap_fetch_overview($mailbox, $email_number, 0);
        //$message = imap_fetchbody($mailbox, $email_number, 2);
        $structure = imap_fetchstructure($mailbox, $email_number);
        $attachments = getEmailAttachments($mailbox, $email_number, $structure);
        $returnArray["html"] .= '<tr>';
        $returnArray["html"] .= '<td style="font-size: 11px;">' . $email_number . '</td>';
        $returnArray["html"] .= '<td style="font-size: 11px;">' . $overview[0]->from . '</td>';
        $returnArray["html"] .= '<td style="font-size: 11px;">' . date("Y-m-d", strtotime($overview[0]->date)) . '</td>';
        $returnArray["html"] .= '<td style="font-size: 11px;">' . count($attachments) . '</td>';
        $status .= '<ul class="pointmark" style="margin: 0px;">';
        if (count($attachments) > 0) {
            // Leer cada adjunto XML y procesarlo
            foreach ($attachments as $attachment) {
                if (strtolower($attachment["xml_extension"]) == "xml") {
                    $validArray = processXmlString($attachment["xml_attachment"], $attachment["pdf_attachment"], $attachment["pdf_extension"], $rucReceptor, $attachment["xml_basename"]);
                    $processed = $validArray["status"];
                }
                if ($processed) {
                    $status .= "<li>Adjunto XML (" . $attachment["xml_basename"] . "): Procesado con éxito</li>";
                } else {
                    $status .= "<li>" . $validArray["html"] . "</li>";
                }
            }
        } else {
            $status .= "<li>E-mail no tiene adjuntos</li>";
            $processed = false;
            $usuarioDefault = FlowSettingsCore::get(FLOW_RECEPCIONDOCUMENTOS, "RDE_DEF_ASIGNACION");
            $usuarioData = $handlerUserCore->getUserData($usuarioDefault);
            $email = $usuarioData["user_email"];
            $html = 'Estimado usuario<br /><br />
                     Le informamos que tiene un nuevo documento electrónico descargable en el buzón. Por favor ingrese a revisarlo y darle tratamiento';
            MailController::sendGeneralMail([["email" => $email]], "Nuevo documento electrónico descargable", $html);
        }
        $status .= '</ul>';
        if (FlowSettingsCore::get(FLOW_RECEPCIONDOCUMENTOS, "RDE_MC_PRUEBAS") != "1") {
            setEmailRead($email_number, $rucReceptor);
        } else {
            imap_clearflag_full($mailbox, $email_number, "\\Seen");
        }
        $returnArray["html"] .= '<td style="font-size: 11px;">' . $status . '</td>';
        if ($processed) {
            $returnArray["html"] .= '<td><span class="awe-ok" style="color: #6b9b20;"></span></td>';
        } else {
            $returnArray["html"] .= '<td><span class="awe-remove" style="color: #d43f3f;"></span></td>';
        }
        $returnArray["html"] .= '</tr>';
    }
    $returnArray["html"] .= "</table>";
    return $returnArray;
}
Exemplo n.º 12
0
<?php

/**
 * @author         Pierre-Henry Soria <*****@*****.**>
 * @copyright      (c) 2012-2016, Pierre-Henry Soria. All Rights Reserved.
 * @license        GNU General Public License; See PH7.LICENSE.txt and PH7.COPYRIGHT.txt in the root directory.
 * @package        PH7 / App / System / Module / User
 */
namespace PH7;

defined('PH7') or die('Restricted access');
// Automatic connection
if (!UserCore::auth() && Framework\Registry\Registry::getInstance()->action != 'soon') {
    $oCookie = new Framework\Cookie\Cookie();
    if ($oCookie->exists(array('member_remember', 'member_id'))) {
        if ((new ExistsCoreModel())->id($oCookie->get('member_id'))) {
            $oUserModel = new UserCoreModel();
            $oUser = $oUserModel->readProfile($oCookie->get('member_id'));
            if ($oCookie->get('member_remember') === Framework\Security\Security::hashCookie($oUser->password)) {
                (new UserCore())->setAuth($oUser, $oUserModel, new Framework\Session\Session());
            }
        }
    }
    unset($oCookie);
}
Exemplo n.º 13
0
function getHtmlDistribucion($cabeceraRecord)
{
    $handlerTaskCore = new TaskCore();
    $handlerUserCore = new UserCore();
    $flowSettingsHandler = new FlowSettingsCore();
    $handlerDocumentoCabeceraCore = new DocumentoCabeceraCore();
    $handlerDocumentoLineaCore = new DocumentoLineaCore();
    $handlerDistribucionCabeceraCore = new DistribucionCabeceraCore();
    $handlerDistribucionLineaCore = new DistribucionLineaCore();
    $handlerRequestMetadataCore = new RequestMetadataCore();
    $cabeceraData = $handlerDocumentoCabeceraCore->getRecordById($cabeceraRecord["id"]);
    $lineasData = $handlerDocumentoLineaCore->getRecordsByFieldFilter(array(array("field" => "id_documento", "type" => "i", "value" => $cabeceraRecord["id"])));
    $numero_req = $handlerRequestMetadataCore->getVariable($cabeceraRecord["ef_id"], "RDE-NUMERO-REQ");
    $numero_oc = $handlerRequestMetadataCore->getVariable($cabeceraRecord["ef_id"], "RDE-NUMERO-OC");
    $reclamo_seguro = $handlerRequestMetadataCore->getVariable($cabeceraRecord["ef_id"], "RDE-RECLAMO-SEGURO");
    $comentarios = $handlerRequestMetadataCore->getVariable($cabeceraRecord["ef_id"], "RDE-COMENTARIO");
    $dataPasosAprobador1 = $handlerTaskCore->getTaskDataByRequestFlowStep($cabeceraRecord["ef_id"], $_SESSION["user_flow"], $flowSettingsHandler->getSettingValue($_SESSION["user_flow"], "RDE_STEP_APROBACION_1"));
    $dataPasosAprobador2 = $handlerTaskCore->getTaskDataByRequestFlowStep($cabeceraRecord["ef_id"], $_SESSION["user_flow"], $flowSettingsHandler->getSettingValue($_SESSION["user_flow"], "RDE_STEP_APROBACION_2"));
    $aprobador1 = "";
    $aprobador2 = "";
    if (count($dataPasosAprobador1) > 0) {
        $dataAprobador1 = $handlerUserCore->getUserData($dataPasosAprobador1[0]["task_assignedto"]);
        $aprobador1 = $dataAprobador1["user_name"];
    }
    if (count($dataPasosAprobador2) > 0) {
        $dataAprobador2 = $handlerUserCore->getUserData($dataPasosAprobador2[0]["task_assignedto"]);
        $aprobador2 = $dataAprobador2["user_name"];
    }
    $lineasHtml = "";
    foreach ($lineasData as $linea) {
        $distribucionLineaHtml = '';
        if ($cabeceraRecord["tipo_distribucion"] == "detallada") {
            $lineasDistribucionData = $handlerDistribucionLineaCore->getRecordsByFieldFilter(array(array("field" => "id_documento_linea", "type" => "i", "value" => $linea["id"])));
            foreach ($lineasDistribucionData as $lineaDist) {
                $distribucionLineaHtml .= $lineaDist["cc_id"] . '  : ' . $lineaDist["porcentaje"] . '% ($ ' . number_format($lineaDist["valor_distribuido"], 2, '.', '') . ')<br />';
            }
        }
        $lineasHtml .= '<tr>';
        $lineasHtml .= '<td>' . $linea["descripcion"] . '</td>';
        $lineasHtml .= '<td>' . number_format($linea["cantidad"], 2, '.', '') . '</td>';
        $lineasHtml .= '<td>$ ' . number_format($linea["precioUnitario"], 2, '.', '') . '</td>';
        $lineasHtml .= '<td>' . $distribucionLineaHtml . '</td>';
        $lineasHtml .= '<td>$ ' . number_format($linea["precioTotalSinImpuesto"], 2, '.', '') . '</td>';
        $lineasHtml .= '</tr>';
    }
    $lineasHtml .= '<tr>
                            <td colspan="4" class="subtitle" style="text-align: right; background-color: #eee;">Subtotal IVA 12%</td>
                            <td>$ ' . number_format($cabeceraData["subtotalIva12"], 2, '.', '') . '</td>
                        </tr>';
    $lineasHtml .= '<tr>
                            <td colspan="4" class="subtitle" style="text-align: right; background-color: #eee;">IVA 12%</td>
                            <td>$ ' . number_format($cabeceraData["subtotalIva12"], 2, '.', '') . '</td>
                        </tr>';
    $lineasHtml .= '<tr>
                            <td colspan="4" class="subtitle" style="text-align: right; background-color: #eee;">Subtotal IVA 0%</td>
                            <td>$ ' . number_format($cabeceraData["subtotalIva0"], 2, '.', '') . '</td>
                        </tr>';
    $lineasHtml .= '<tr>
                            <td colspan="4" class="subtitle" style="text-align: right; background-color: #eee;">Subtotal Sin IVA</td>
                            <td>$ ' . number_format($cabeceraData["subtotalSinIva"], 2, '.', '') . '</td>
                        </tr>';
    $lineasHtml .= '<tr>
                            <td colspan="4" class="subtitle" style="text-align: right; background-color: #eee;">Importe Total</td>
                            <td>$ ' . number_format($cabeceraData["importeTotal"], 2, '.', '') . '</td>
                        </tr>';
    $distribucionGlobalHtml = '';
    if ($cabeceraData["distribucion"] == "global") {
        $cabeceraDistribucionData = $handlerDistribucionCabeceraCore->getRecordsByFieldFilter(array(array("field" => "id_documento", "type" => "i", "value" => $cabeceraData["id"])));
        if (count($cabeceraDistribucionData) > 0) {
            $distribucionGlobalHtml .= '<h3>Distribución global</h3> 
                                            <table style="width: 100%;">
                                                <tr style="background-color: #ddd;">
                                                    <td class="strong centered subtitle" style="width: 70%; font-weight: bold;">Centro de costo</td>
                                                    <td class="strong centered subtitle" style="width: 15%; font-weight: bold;">Porcentaje</td>
                                                    <td class="strong centered subtitle" style="width: 15%; font-weight: bold;">Valor distribuido</td>
                                                </tr>';
            foreach ($cabeceraDistribucionData as $cabecera) {
                $distribucionGlobalHtml .= '<tr>';
                $distribucionGlobalHtml .= '<td style="width: 70%;">' . $cabecera["cc_id"] . ' - ' . $cabecera["cc_nombre"] . '</td>';
                $distribucionGlobalHtml .= '<td style="width: 15%;">' . $cabecera["porcentaje"] . '</td>';
                $distribucionGlobalHtml .= '<td style="width: 15%;">$ ' . number_format($cabecera["valor_distribuido"], 2, '.', '') . '</td>';
                $distribucionGlobalHtml .= '</tr>';
            }
            $distribucionGlobalHtml .= ' </table>';
        }
    }
    $html = '	<table style="width: 100%;">
						<tr>
	                        <td><strong>Tipo: </strong></td>
	                        <td>Factura</td>
	                        <td><strong>Número: </strong></td>
	                        <td>' . $cabeceraRecord["factura"] . '</td>
	                        <td><strong>Fecha: </strong></td>
	                        <td>' . $cabeceraRecord["fecha"] . '</td>
	                    </tr>
	                    <tr>
	                        <td><strong>Proveedor: </strong></td>
	                        <td>' . $cabeceraRecord["proveedor"] . '</td>
	                        <td><strong>N° requisición: </strong></td>
	                        <td>' . $numero_req . '</td>
	                        <td><strong>N° orden de compra: </strong></td>
	                        <td>' . $numero_oc . '</td>
	                    </tr>

	                    <tr>
	                        <td><strong>Comentarios: </strong></td>
	                        <td colspan="5">' . $comentarios . '</td>
	                    </tr>

	                    <tr>
	                        <td colspan="6" class="unbordered">&nbsp;</td>
	                    </tr>
	                    <tr>
	                        <td colspan="6">
	                            
	                            <h3>Detalles de documento</h3>

	                            <table style="width: 100%;">
	                                <tr style="background-color: #ddd;">
	                                    <td><strong>Descripción</strong></td>
	                                    <td style="width: 10%;"><strong>Cantidad</strong></td>
	                                    <td style="width: 10%;"><strong>V. Uni</strong>.</td>
	                                    <td><strong>Distribución</strong></td>
	                                    <td style="width: 10%;"><strong>Total</strong></td>
	                                </tr>
	                                ' . $lineasHtml . '
	                            </table>

	                            <br /> 

	                            ' . $distribucionGlobalHtml . '

	                            <br /> 

	                        </td>
	                    </tr>
	                    <tr>
	                        <td colspan="6" class="unbordered">&nbsp;</td>
	                    </tr>
	                </table>

					';
    return $html;
}
Exemplo n.º 14
0
<?php

/**
 * @title          Set User Last Activity
 *
 * @author         Pierre-Henry Soria <*****@*****.**>
 * @copyright      (c) 2012-2014, Pierre-Henry Soria. All Rights Reserved.
 * @license        GNU General Public License; See PH7.LICENSE.txt and PH7.COPYRIGHT.txt in the root directory.
 * @package        PH7 / App / System / Module / User / Asset / Ajax
 * @version        1.0
 */
namespace PH7;

defined('PH7') or exit('Restricted access');
// Only for members
if (UserCore::auth()) {
    (new UserCoreModel())->setLastActivity((new Framework\Session\Session())->get('member_id'));
}