public static function parse(&$line)
 {
     $alertMessage = new AlertMessage();
     /* from php.net
      * If matches is provided, then it is filled with the results of 
      * search. $matches[0] will contain the text that matched the 
      * full pattern, $matches[1] will have the text that matched the 
      * first captured parenthesized subpattern, and so on. 
      */
     if (preg_match(self::MESSAGE_PATTERN, trim($line), $matches)) {
         $alertMessage->setMessage($matches[1]);
     }
     if (preg_match(self::REVISION_PATTERN, trim($line), $matches)) {
         $alertMessage->setRevision($matches[1]);
         echo "Rev Set: " . $matches[1] . "<br/>";
         echo "Line is: " . htmlentities(trim($line)) . "<br/>";
     }
     if (preg_match(self::SEVERITY_PATTERN, trim($line), $matches)) {
         $alertMessage->setSeverity($matches[1]);
     }
     if (preg_match(self::ID_PATTERN, trim($line), $matches)) {
         $alertMessage->setId($matches[1]);
     }
     if (preg_match(self::GENERAL_MESSAGE_PATTERN, trim($line), $matches)) {
         $alertMessage->setGeneralMessage($matches[1]);
     }
     if (preg_match(self::TECHNICAL_MESSAGE_PATTERN, trim($line), $matches)) {
         $alertMessage->setTechnicalMessage($matches[1]);
     }
     return $alertMessage;
 }
 public function checkCpfDuplicity($cpf_to_check)
 {
     $exists = $this->loadedModel->getObjects(array("fields" => "nome_completo", "where" => "CPF = '" . $cpf_to_check . "'"));
     if (count($exists)) {
         AlertMessage::display(array('type' => AlertMessage::ERROR, 'message' => 'Este <b>CPF</b> já existe dentro do sistema com o <b>Nome</b> de: <b>' . $exists[0]["nome_completo"] . '</b>'));
     } else {
         echo "";
     }
 }
 public function add($processed = array())
 {
     $this->load->database();
     foreach ($processed as $field_name => $field_value) {
         $this->db->set($field_name, $field_value);
     }
     /*echo $this->db->get_compiled_insert($this->getTable());
     		SystemHelper::continuePopupWindow();
     		exit;*/
     if ($this->debugMode) {
         AlertMessage::display(array('type' => AlertMessage::INFO, 'icon' => 'fa fa-bug', 'message' => '<b>SQL Debug:</b> <br><br>' . $this->db->get_compiled_insert($this->getTable(), false)));
     }
     if (!$this->checkExists($processed)) {
         $try_insert = @$this->db->insert($this->getTable());
         if ($try_insert) {
             $this->_generated_inserted_id = $this->db->insert_id($this->getTable());
             $this->last_runned_sql = $this->db->last_query();
             $this->db->close();
             return true;
         } else {
             $this->last_runned_sql = $this->db->last_query();
             throw new Exception("Desculpe, não foi possivel adicionar o item. Algum problema ocorreu, possivelmente uma duplicidade de cadastro. Favor verifique.");
             $this->db->close();
             return false;
         }
     }
 }
 public function update($FORMDATA, $optionals = array())
 {
     $PROCESSED_INPUT = $this->beforeUpdate($FORMDATA);
     try {
         if ($this->loadedModel->update($PROCESSED_INPUT)) {
             $this->loadObjectDataFields();
             $this->afterUpdate();
             if (isset($optionals["noAlert"]) && $optionals['noAlert']) {
                 return true;
             }
             AlertMessage::display(array('type' => AlertMessage::SUCCESS, 'message' => 'Atualizado com sucesso', 'icon' => 'ls-ico-checkmark'));
             return true;
         }
     } catch (Exception $ex) {
         AlertMessage::display(array('type' => AlertMessage::ERROR, 'message' => $this->setLastError($ex) . " <br>SQL: " . $this->loadedModel->getLastSQL(), 'icon' => 'ls-ico-close'));
         SystemHelper::preventPopupResultClosing();
         return false;
     }
 }
Example #5
0
            $("#messages-container, #btn-write-message, #message-top-buttons-container").show();
            $("#message-write").hide();
            e.stopPropagation();

            Messages.viewFolder('sent', 1);
            // TODO: notifica l'utente che il messaggio e' stato inviato
        }
    });
    
    $(function(){
        // Autocomplete
        Autocomplete.Bind("div#messages input[name='to']", "/restful/user/search.php", {
            params: {"num_records" : 5}
        });

        // Visualizza la cartella in arrivo
        Messages.viewFolder('inbox', 1);
    });
</script>

    <?php 
} else {
    $error_message = 'Devi effettuare il login per vedere questa pagina!';
    AlertMessage::Show($error_message, AlertMessage::WARN);
}
?>
</div>
    

<?php 
require_once ROOT_PATH . "footer.php";
Example #6
0
            if ($next_chapter != NULL) {
                $back_next_button .= '<div style="float:right;">
            <button class="btn" onclick="location.href=\'' . $next_chapter->getLink() . '\';">&raquo;<span class="hide-phone"> Prossimo</span></button>
          </div>';
            }
            $back_next_button .= "</div>";
            $author = $chapter->getAuthor();
            echo $back_next_button;
            echo "<div id='chapter-context' class='left' style='margin: 1em 0;'>" . $chapter->getContent() . "</div>";
            if ($author == null) {
                echo "<div>A cura di: Membro non piu' appartenente alla Community </div>";
            } else {
                echo "<div>A cura di: <a href='" . $author->getProfileUrl() . "'>{$author['username']}</a></div>";
            }
            echo $back_next_button;
            echo "</div>";
        } else {
            AlertMessage::Show('Capitolo selezionato insesistente!', AlertMessage::WARN);
        }
    } else {
        require_once ROOT_PATH . "header.php";
        AlertMessage::Show('Guida selezionata insesistente!', AlertMessage::WARN);
    }
} else {
    require_once ROOT_PATH . "header.php";
    AlertMessage::Show('Nessuna guida/capitolo selezionato!', AlertMessage::WARN);
}
?>

<?php 
require_once ROOT_PATH . "footer.php";
Example #7
0
			<?php 
    echo $topic->getName();
    ?>
			<span class="hide-phone hide-tablet"> - <?php 
    echo $topic->getFormattedDate();
    ?>
</span>
			</a>
		</li>
<?php 
}
?>
</ul>


<?php 
echo AlertMessage::Get("Vi ricordiamo che questo sito e' un lavoro in corso, \n\t\tquindi errori e mancanza di funzionalita' sono perfettamente normali a questo punto.<br/><br/>\n\n\t\t<ul style='margin-left: 20px;'>\n\t\t\t<li style='margin-bottom: 20px;'>Se trovi un errore <button class='btn' onclick=\"location.href='http://www.pierotofy.it/p/extras/forum/572/';\">segnalalo agli sviluppatori</button></li>\n\t\t\t<li style='margin-bottom: 20px;'>Se vuoi contribuire e partecipare assieme al nostro fantastico team di sviluppo <button class='btn' onclick=\"location.href='http://devwiki.pierotofy.it';\">visita il nostro wiki</button></li>\n\t\t\t<li style='margin-bottom: 20px;'>Se sei curioso di vedere il sorgente <button class='btn' onclick=\"location.href='http://svn.pierotofy.it';\">clicca qui</button></li>\n\t\t</ul>", AlertMessage::WARN);
?>


	<div class="center">
		<img src="/images/eagle.jpg" alt="PieroTofy.it" style="float: left; margin-top: 14px; margin-right: 16px; margin-bottom: 16px;"/>
	</div>
	<p>Benvenuti nella versione mobile di <a href="http://www.pierotofy.it">PieroTofy.it</a>! <strong>Questa e' una home page temporanea</strong>, verra' presto rimpiazzata da una lista di discussioni.</p>
	<p>
		Nel frattempo, assicurati di provare ad usare il <a href="/p/forum/">forum</a> e loggati per leggere la tua posta in arrivo.
	</p>
	<div class="clear"></div>

<?php 
require_once ROOT_PATH . "footer.php";
Example #8
0
<?php

/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
require_once "__inc__.php";
$pagTitle = "Guide";
require_once ROOT_PATH . "header.php";
$navlist = GuideManager::getPublishedNavList();
if ($navlist == null) {
    AlertMessage::Show('Errore: nessuna guida trovata', AlertMessage::WARN);
} else {
    echo $navlist;
}
require_once ROOT_PATH . "footer.php";
Example #9
0
<?php

/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
require_once "__inc__.php";
validate_num($_GET['id']);
validate_num($_GET['p']);
$forum_info = Forum::GetForumInfo($_GET['id']);
$pagTitle = "Forum " . $forum_info['title'];
$backUrl = "/p/forum/";
require_once ROOT_PATH . "header.php";
if (!Forum::IsAccessGrantedTo($forum_info, $currentUser)) {
    AlertMessage::Show("Non hai i permessi per visualizzare questo forum.", AlertMessage::WARN);
    ndie();
}
// TODO: cerca topic
// argument e' l'id del canale del forum (Android, C++, Off-Topic, etc.)
$limit = DB::GetLimit($_GET['p'], Forum::TOPICS_PER_PAGE);
$q = exequery(DB::SelectCalcFoundRows(Topic::SELECT_SQL) . "\n\t\t\t\tWHERE p.argument = {$_GET['id']} AND p.type = " . Forum::TYPE_TOPIC . " \n\t\t\t\tORDER BY p.show_as DESC, p.last_post_date DESC\n\t\t\t\tLIMIT {$limit}");
$topics_count = DB::GetCalcFoundRows();
// TODO: aggiungi indice su show_as
?>

<div class="center" style="margin-bottom: 1em;"> <!-- nuovo post -->
	<?php 
$formBuilder = new FormBuilder("frm-forum-post", "/restful/forum/newtopic.php");
$fields = array();
$fields[] = array("id" => "subject", "type" => "textinput", "label" => "Oggetto:", "validation" => "required,Specifica un oggetto per il messaggio");
$fields[] = array("id" => "poll", "type" => "textarea", "label" => "Sondaggio:<br/><span class='small'>(1 domanda per linea)</span>", "attrs" => "style='height: 6em;'");
$fields[] = array("id" => "message", "type" => "textarea", "validation" => "required,Devi scrivere un messaggio");
 public function processEdit($user_id)
 {
     if ($this->input->post("PERMISSION")) {
         foreach ($this->loadedModel->getObjects(array("where" => "usuario_id = '" . $user_id . "'")) as $index => $perm) {
             if (!isset($this->input->post("PERMISSION")[$perm["nome_permissao"]])) {
                 $this->loadedModel->remove_where(array("usuario_id" => $user_id, "nome_permissao" => $perm["nome_permissao"]));
             }
         }
         foreach ($this->input->post("PERMISSION") as $index => $permName) {
             if (!empty($permName) && !self::havePermission($permName, $user_id)) {
                 $this->loadedModel->add(array("nome_permissao" => $permName, "usuario_id" => $user_id));
             }
         }
     } else {
         $this->loadedModel->remove_where(array("usuario_id" => $user_id));
     }
     AlertMessage::display(array('type' => AlertMessage::SUCCESS, 'icon' => 'ls-ico-checkmark', 'msg' => 'Permissões atualizadas com sucesso!'));
 }
		<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1">
		<link rel="icon" type="favicon" type="image/x-icon" href="<?php 
echo ROOT_PATH . "assets/images/easycasting.ico";
?>
">
		<meta name="viewport" content="user-scalable=no,width=device-width, initial-scale=1"/>
	</head>
	<body>
		<div class="loginContainer">
			<div class="loginLogo"><img src='assets/images/logoMenu.png' width="" height=""></img></div>
			<div class="loginForm">
				<span>Autênticação de usuário</span>
				<?php 
if (!empty($error_msg)) {
    echo "<br><br>";
    AlertMessage::display(array('type' => AlertMessage::ERROR, 'icon' => 'ls-ico-user', 'style' => 'margin-bottom:0;', 'msg' => $error_msg));
}
?>
				
				<form method="post" action="doLogin">
					<?php 
SystemHelper::addTextfield(array('label' => 'Usuário', 'placeholder' => 'Informe seu usuário', 'name' => 'login_username'));
SystemHelper::addPasswordfield(array('label' => 'Senha', 'style' => 'margin-bottom:10px', 'placeholder' => 'Informe sua senha', 'name' => 'login_password'));
?>
					
					<div class="loginFormButtons">
						<?php 
SystemHelper::addSubmitButton(array('label' => 'Entrar', 'icon' => 'fa fa-sign-in'));
?>
					</div>
				</form>