Exemple #1
0
 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 
*/
include 'kernel/skin.class.php';
$skin = new CSkin();
if (!empty($_GET['action'])) {
    $action = $_GET['action'];
} else {
    $skin->redirect('index.php');
}
function clean($text)
{
    preg_match_all('/\\[(.*)\\](.*)\\[\\/(.*)\\]/si', $text, $matches);
    foreach ($matches[0] as $key => $match) {
        if ($matches[1][$key] == $matches[3][$key]) {
            $text = str_replace($match, $matches[2][$key], $text);
        }
    }
    return $text;
}
try {
    $errorrep = $config->getConfigByNameType('general/errorreporting', TYPE_INT);
} catch (exceptionlist $e) {
    // this is a big errror so $errorep = true
 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Library General Public License for more details.
 
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 
*/
include 'kernel/skin.class.php';
$skin = new CSkin();
if (!empty($_GET['action'])) {
    $action = $_GET['action'];
} else {
    $skin->redirect('index.php');
}
try {
    $errorrep = $config->getConfigByNameType('general/errorreporting', TYPE_INT);
} catch (exceptionlist $e) {
    // this is a big errror so $errorep = true
    $link = $skin->catchError($e, 'index.php?', $lang->translate('You can\'t view this page'), true);
    $database->close();
    $skin->redirect($link);
}
switch ($action) {
    case 'login':
        try {
            $exception = NULL;
            if (empty($_POST[POST_NAME])) {
                $e = new exceptionlist($lang->translate('You must fill in the username field'));
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 
*/
include 'kernel/skin.class.php';
$skin = new CSkin();
if (!empty($_GET['action'])) {
    $action = $_GET['action'];
} else {
    $theme->redirect('index.php');
}
try {
    $errorrep = $config->getConfigByNameType('general/errorreporting', TYPE_INT);
} catch (exceptionlist $e) {
    // this is a big errror so $errorep = true
    $link = $skin->catchError($e, 'index.php?', $lang->translate('Your action has no effect'), true);
    $database->close();
    $skin->redirect($link);
}
switch ($action) {
    case 'vote':
        try {
            $return = $poll->vote($_POST, $user->getconfig('name'));
            $database->close();
            $skin->redirect('index.php?note=' . $lang->translate('You have voted'));
            break;
        } catch (exceptionlist $e) {
            $skin->redirect($skin->catchError($e, 'index.php?', $lang->translate('Your vote is not saved'), $errorrep));
        }
    case 'allpolls':
        try {
            $skin->loadSkinFile('viewpolls.html');
        } catch (exceptionlist $e) {