function sql_do($sql)
{
    global $igoandb;
    try {
        return $igoandb->query($sql);
    } catch (DatabaseException $e) {
        append_error_exit($e->getMessage());
    }
}
Esempio n. 2
0
# Igoan 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 Igoan; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
#
require_once 'igoan/User.class';
$me = user_get_by_id($_SESSION['id']);
if (!$me) {
    append_error_exit('User ID inexistent.');
}
if (!$me->is_global_admin()) {
    append_error_exit('Permission denied: global admin flag required');
}
?>
<h1>Gestion des users</h1>

<p>
Voici la liste complète des utilisateurs.
</p>

<?php 
$users = user_get_all();
if (!count($users)) {
    echo '<p><em>Il n\'y a pas d\'utilisateur dans la base actuellement.</em></p>';
} else {
    echo '<table><tr><th>id_user</th><th>name_user</th><th>mail</th><th>url</th><th>login</th><th>passwd</th></tr>';
    foreach ($users as $user) {
Esempio n. 3
0
# the Free Software Foundation in the version 2 of the License.
#
# Igoan 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 Igoan; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
#
require_once 'igoan/User.class.php';
if (isset($_GET['action']) && $_GET['action'] == 'Change Password' && isset($_GET['oldpass']) && isset($_GET['passwd1']) && isset($_GET['passwd2'])) {
    $me = user_get_by_id($_SESSION['id']);
    if (!$me) {
        append_error_exit('User ID incorrect.');
    }
    // check the old password
    if ($_GET['oldpass'] != $me->get_passwd()) {
        append_error('Wrong old password.');
    } else {
        if ($_GET['passwd1'] != $_GET['passwd2']) {
            append_error('Passwords mismatch');
        } else {
            if (empty($_GET['passwd1'])) {
                append_error('Aha. Yes of course ...');
            }
        }
    }
    if (errors()) {
        flush_errors();
Esempio n. 4
0
#
# You should have received a copy of the GNU General Public License
# along with Igoan; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
#
require_once 'igoan/User.class.php';
if (!$_SESSION['id']) {
    append_error_exit('You must be logged to edit yourself!');
}
$me = user_get_by_id($_SESSION['id']);
if (!$me) {
    append_error_exit('Invalid login. Please re-login.');
}
if (!empty($_GET['id_user'])) {
    if ($_GET['id_user'] != $me->get_id_user()) {
        append_error_exit('You are user #' . $me->get_id_user() . ' and are editing user #' . $_GET['id_user'] . '! Please correct.');
    }
    if (!empty($_GET['name_user'])) {
        $me->set_name_user($_GET['name_user']);
    }
    if (isset($_GET['desc_user'])) {
        $me->set_desc_user($_GET['desc_user']);
    }
    if (isset($_GET['url_user'])) {
        $me->set_url_user($_GET['url_user']);
    }
    if (!empty($_GET['mail'])) {
        $me->set_mail($_GET['mail']);
    }
    if (isset($_GET['photo'])) {
        // TODO: prendre en compte la photo
Esempio n. 5
0
		</p>
		<p style="margin-bottom: 0.5em">
			Please enter the admin Igoan login name:
		</p>
		<div class="block">
			<label for="login"> Login name: </label>
			<input title="" id="login" name="login" type="text" value="<?php 
            if (isset($_GET['login'])) {
                echo $_GET['login'];
            }
            ?>
" />
		</div>
	</div><?php 
        } else {
            append_error_exit('what\'s the f**k!!?');
        }
    }
}
?>
	<h2> Submit </h2>
	<div class="misc" style="color: #000000; padding-top: 0;">
		<p>
		Everybody likes submit buttons! Blah.
		</p>
		<div class="block">
			<input type="submit" id="submit" name="submit" value="Submit!" />
		</div>
	</div>
	</form>
</div>
Esempio n. 6
0
# Igoan is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation in the version 2 of the License.
#
# Igoan 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 Igoan; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
#
// existence de la release
if (!isset($_GET['idRel']) || $_GET['idRel'] != 123460) {
    append_error_exit('Bad Release ID');
}
if (isset($_GET['confirm']) && $_GET['confirm'] == 'Yes') {
    // do the job
    append_error('Release successfully deleted');
    http_redir('/project/view_project.php?idPrj=456789');
}
?>

<h1>Release Deletion</h1>

Do you really want to delete this release 'GraphTool' version 'graphtool-0.2-pre1' ?
<form>
	<input type="submit" name="confirm" value="Yes" />
	<input type="hidden" name="idRel" value="123460" /></form>
<form action="/project/view_release.php">
Esempio n. 7
0
require_once 'igoan/User.class.php';
// PRELIMINARIES
$me = user_get_by_id($_SESSION['id']);
if (!$me) {
    append_error_exit('You must be logged to add a new branch.');
}
$id_prj = empty($_GET['id_prj']) ? 0 : $_GET['id_prj'];
if (!$id_prj) {
    append_error_exit('You have to specify a project.');
}
$prj = project_get_by_id($id_prj);
if (!$prj) {
    append_error_exit('Invalid project number #' . $id_prj . '.');
}
if (!$prj->is_admin($me->get_id_user())) {
    append_error_exit('Sorry, you are not an admin for this project.');
}
// ADDING A BRANCH
if (!empty($_GET['name_branch'])) {
    $id_branch = branch_new($_GET['name_branch'], $prj->get_id_prj());
    $branch = branch_get_by_id($id_branch);
    if (!$branch) {
        append_error('Unable to create a new branch');
    }
    if (!errors()) {
        http_redir('/project/view.php?id_branch=' . $branch->get_id_branch());
    }
}
?>