Example #1
0
 public function can_be_retrieved()
 {
     $user = need_authentication();
     $event = Event::get_from_id($this->event_id);
     if (is_admin_logged() || $this->user_id == $user->id || $event->user_id == $user->id) {
         debug("Can administrate.");
         return TRUE;
     }
     debug("Cannot administrate.");
     return FALSE;
 }
        ?>
	<br/>{{Please click}} <a href="?action=request_for_publication&amp;id=<?php 
        echo $event->id;
        ?>
">{{here}}</a> {{to request its publication to our support.}}
<?php 
    } else {
        ?>
	<br/>{{A request for publication has been done. Our support team is going to process it very soon.}}
<?php 
    }
    ?>
</div>
<?php 
}
if (is_admin_logged() && !$event->is_inactivated()) {
    ?>
<div id="evt_administration" class="evt_shadowed">
	<div class="evt_administration_title evt_admin">
		Event Biller Admin
	</div>
	<div class="evt_administration_body">
		<ul>
			<li>Organizer: <a href="?action=retrieve&amp;type=account&amp;id=<?php 
    echo $organizer->id;
    ?>
"><?php 
    echo $organizer->email;
    ?>
</a></li>
		</ul><br/>
Example #3
0
 public function can_be_administrated()
 {
     if (is_admin_logged() || $this->user_id == User::get_id_from_account()) {
         debug("Can administrate.");
         return TRUE;
     }
     debug("Cannot administrate.");
     return FALSE;
 }
Example #4
0
<?php

session_start();
define("BASE_DIR", ".");
require_once BASE_DIR . "/include/constants.inc";
require_once BASE_DIR . "/" . SETTINGS_INI;
require_once BASE_DIR . "/include/globals.inc";
require_once BASE_DIR . '/include/install.inc';
require_once BASE_DIR . '/include/authentication.inc';
$error_msg = '';
if (!is_admin_logged()) {
    if (!TEST_MODE) {
        redirect_to("index.php");
    }
}
if (isset($_POST['toggle_test_mode'])) {
    chmod(BASE_DIR . "/" . SETTINGS_INI, 0755);
    $content = file_get_contents(BASE_DIR . "/" . SETTINGS_INI);
    $value = 'true';
    if (TEST_MODE) {
        $value = 'false';
    }
    $content = preg_replace("#define\\('TEST_MODE', (.*)\\);#", "define('TEST_MODE', {$value});", $content);
    file_put_contents(BASE_DIR . "/" . SETTINGS_INI, $content);
    chmod(BASE_DIR . "/" . SETTINGS_INI, 0400);
    redirect_to('index.php');
}
if (isset($_POST['remove_settings_only'])) {
    chmod(BASE_DIR . "/" . SETTINGS_INI, 0755);
    unlink(BASE_DIR . "/" . SETTINGS_INI);
    ?>
Example #5
0
	<div id="evt_menu">
<?php 
require_once $g_i18n->filename("etc/presentation.html");
?>
		<a class="evt_button" href="?action=get_form&amp;type=event">{{Declare an event}}</a>
		<a class="evt_button" href="events">{{Explore events}}</a>
<?php 
// Verify if user is logged in to show differents menu.
if (is_admin_logged()) {
    ?>
			<a class="evt_button" href="?action=supervision">{{Events supervision}}</a>
<?php 
    // Verify if user is logged in to show differents menu.
} else {
    if (is_logged()) {
        ?>
			<a class="evt_button" href="?action=supervision">{{Manage my events}}</a>
<?php 
    }
}
?>
	</div>
    ?>
€</td>
		<td><?php 
    echo $lastname;
    ?>
</td>
		<td><?php 
    echo $firstname;
    ?>
</td>
		<td><?php 
    echo $user->email;
    ?>
</td>
<?php 
    if (is_admin_logged() && !$bill->is_really_paid()) {
        ?>
		<td><a class="evt_button evt_btn_small" href="?action=confirm&amp;type=bill&amp;id=<?php 
        echo $bill->id;
        ?>
">{{Confirm}}</a></td>
		<td><a class="evt_button evt_btn_small" href="?action=delete&amp;type=bill&amp;id=<?php 
        echo $bill->id;
        ?>
">{{Delete}}</a></td>
<?php 
    }
    ?>
	</tr>
<?php 
}
Example #7
0
 public function check_owner()
 {
     debug("user_id=" . $this->id . " | session_user_id=" . $_SESSION["user_id"]);
     return $this->id == $_SESSION["user_id"] || is_admin_logged();
 }