Exemplo n.º 1
0
# 59 Temple Place,
# Suite 330,
# Boston, MA 02111-1307  USA
#
# $Id: save_question.php,v 1.1 2005/04/10 23:24:02 filetreefrog Exp $
##################################################
if (!defined('EXPONENT')) {
    exit('');
}
$question = null;
if (isset($_POST['id'])) {
    $question = $db->selectObject('poll_question', 'id=' . $_POST['id']);
    if ($question) {
        $loc = unserialize($question->location_data);
    }
}
if (expPermissions::check('manage_question', $loc)) {
    $question = poll_question::update($_POST, $question);
    $question->location_data = serialize($loc);
    if ($db->countObjects('poll_question', "location_data='" . $question->location_data . "'") == 0) {
        $question->is_active = 1;
    }
    if (isset($question->id)) {
        $db->updateObject($question, 'poll_question');
    } else {
        $db->insertObject($question, 'poll_question');
    }
    expHistory::back();
} else {
    echo SITE_403_HTML;
}