Exemplo n.º 1
0
            append_error('Year cannot be empty');
        }
        if (empty($_GET['month'])) {
            append_error('Month cannot be empty');
        }
        if (empty($_GET['day'])) {
            append_error('Day cannot be empty');
        }
        if (!errors() && mktime(0, 0, 0, $_GET['month'], $_GET['day'], $_GET['year']) > time() - 10000) {
            append_error('Date should not be in the future');
        }
        #blabla
        if (!errors()) {
            // do the job
            // recuperer l'idRel fraichement créé
            http_redir('/project/view.php?id_rel=FIXME');
        }
    } else {
        append_error('Malformed form, please use the correct html page');
    }
}
?>
<h1>Add a new release to the project 'GraphTool'</h1>

<?php 
flush_errors();
?>

<form>
<table>
<tr><th>Version name</th><td><input type="text" name="version" value="<?php 
Exemplo n.º 2
0
/*
if ($_SESSION['id'] != 34567) {
	append_error('Can\'t modify project: permission denied');
	http_redir('/project/view_project.php?idPrj=456789');
} */
flush_errors();
if (isset($_GET['action']) && $_GET['action'] == "Apply") {
    if (!isset($_GET['description']) || !isset($_GET['homepage']) || !isset($_GET['screenshot']) || !isset($_GET['download'])) {
        append_error('Invalid arguments');
    } else {
        if (empty($_GET['homepage'])) {
            append_error('Warning: Homepage is mandatory!');
            http_redir('/project/modify_project.php?idPrj=456789');
        } else {
            // do the job: modify the data
            http_redir('/project/view_project.php?idPrj=456789');
        }
    }
} else {
    if (isset($_GET['action']) && $_GET['action'] == "Add an admin for this project") {
        ?>

<h1>Project Administration: GraphTool (<?php 
        echo $_GET['idPrj'];
        ?>
)</h1>

<h2>Add a developer</h2>
<p>Add a user by ID:</p>
<form>
<input type="text" name="byid" /><input type="submit" value="Add" />
Exemplo n.º 3
0
    }
    // 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();
    } else {
        // do the job
        $me->set_passwd($_GET['passwd1']);
        $me->write();
        http_redir('/user/view.php');
    }
}
?>
<h1>Changing your user password</h1>
<form>
Please give your <strong>actual</strong> password first: <input type="password" name="oldpass" /><br />
Then your new password: <input type="password" name="passwd1" /><br />
Twice for verification: <input type="password" name="passwd2" /><br />
<input type="submit" name="action" value="Change Password" />
</form>
Exemplo n.º 4
0
# along with Igoan; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
#
// est-ce que la release existe ?
if (!isset($_GET['idRel']) || $_GET['idRel'] != '123460') {
    append_error('No release specified or release unknown');
    flush_errors_exit();
}
// l'user concerné est-il admin du projet ?
if ($_SESSION['id'] != 34567) {
    append_error('Can\'t modify project: permission denied');
    http_redir('/project/view_release.php?idRel=123460');
}
if (isset($_GET['action']) && $_GET['action'] == 'Apply') {
    // do the job
    http_redir('/project/view_release.php?idRel=123460');
}
?>

<h1>Change release information</h1>

<form>
<table>
<tr><th>idRel</th><td>34567</td></tr>
<tr><th>Version</th><td><input type="text" name="version" value="graphtool-0.2pre1" /></td></tr>
<tr><th>Date</th><td>
	<input type="text" name="year" value="2003" size="4"
	/>-<input type="text" name="month" value="07" size="2"
	/>-<input type="text" name="day" value="30" size="2"></td></tr>
<tr><th>Status</th><td>
	<select name="status">
Exemplo n.º 5
0
# Copyright (c) 2003-2004 Igoan.
# Please see the file CREDITS supplied with Igoan to see the full list
# of copyright holders.
#
# $Id: logout.php,v 1.1 2004/04/08 21:14:45 cam Exp $
#
# This file is part of the Igoan project.
#
# 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
#
# taken from http://fr2.php.net/manual/en/function.html-entity-decode.php
function my_html_entity_decode($given_html, $quote_style = ENT_QUOTES)
{
    $trans_table = array_flip(get_html_translation_table(HTML_SPECIALCHARS, $quote_style));
    $trans_table['&#39;'] = "'";
    return strtr($given_html, $trans_table);
}
unset($_SESSION['id']);
http_redir(empty($_GET['referer']) ? '/index.php' : urldecode(my_html_entity_decode($_GET['referer'])));
Exemplo n.º 6
0
    }
    $my_branch_id = $my_prj->get_default_branch();
    if ($my_branch_id) {
        $my_branch = branch_get_by_id($my_branch_id);
    }
    // c'est possible qu'il n'y ait pas de branche :(
    if ($my_branch) {
        $my_rel_id = $my_branch->get_last_release();
        if ($my_rel_id) {
            $my_rel = release_get_by_id($my_rel_id);
        }
    }
    $request = $my_prj;
} else {
    append_error('No project requested.');
    http_redir('/index.php');
}
// is the visitor an admin/maintainer ?
$isadmin = $me && $my_prj->is_admin($me->get_id_user());
$ismaint = $isadmin || $me && $my_branch->is_maintainer($me->get_id_user());
// the branches and releases to show
$releases = $my_branch ? $my_branch->list_releases() : 0;
$branches = $my_prj->list_branches();
//($my_branch && !$isadmin) ? $my_branch->get_id_branch() : -1);
// processing datas to be shown
// PAGE TITLE
$d_full_title = $my_prj->get_name_prj();
if ($my_rel) {
    $d_full_title .= ' - ' . $my_rel->get_name_rel();
}
if ($branches && $my_branch) {
Exemplo n.º 7
0
    // on crée une branche ...
    if (!errors()) {
        $id_branch = branch_new('main', $prj->get_id_prj());
        if (!$id_branch) {
            sql_do('ROLLBACK');
            append_error('Unable to create the default branch, please contact the administrator.');
        }
    }
    // ... par défaut
    if (!errors()) {
        $prj->set_default_branch($id_branch);
        $prj->write();
    }
    if (!errors()) {
        sql_do('COMMIT');
        http_redir('/project/view.php?id_prj=' . $id_prj);
    } else {
        sql_do('ROLLBACK');
    }
}
header_box("Igoan :: Adding a new project");
flush_errors();
?>
<div id="main">
<form class="admin" action="new_project.php">

<h2>Adding a project</h2>
<div class="abstract">
<p>
Adding a project to our database is as easy as 1, 2, 3:
</p>
Exemplo n.º 8
0
                    }
                    if (empty($_GET['email'])) {
                        append_error('The e-mail address is mandatory.');
                    }
                    if (!errors()) {
                        $user_id = user_new_pseudo($_GET['name'], $_GET['email']);
                    }
                    if (!errors()) {
                        $user = user_get_by_id($user_id);
                        if (!$user) {
                            append_error('Unable to create the pseudo-user ' . $_GET['name']);
                        }
                    }
                    if (!errors()) {
                        $rel->add_author($user->get_id());
                        http_redir('/project/view.php?id_rel=' . $rel->get_id_rel());
                    }
                }
            }
        } else {
            append_error_exit('No action specified.');
        }
    }
}
?>



<?php 
// OUTPUT
header_box('Igoan :: Adding a user as a project member');
Exemplo n.º 9
0
# 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['login']) && isset($_GET['passwd'])) {
    $me = user_get_by_password($_GET['login'], $_GET['passwd']);
    if (!$me) {
        append_error('Login incorrect.');
    } else {
        $_SESSION['id'] = $me->get_id_user();
    }
    if (!errors()) {
        http_redir(empty($_GET['referer']) ? '/index.php' : $_GET['referer']);
    }
}
header_box('Igoan :: Login');
?>

<div id="main">
	<form class="admin" action="login.php">
	<?php 
flush_errors();
?>
	<h2> Login </h2>
	<div class="description">
		<p style="margin-bottom: 1em;">
			Enter your login and password to continue.
		</p>
Exemplo n.º 10
0
$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());
    }
}
?>



<?php 
// OUTPUT
header_box("Igoan :: Adding a new branch to a project");
flush_errors();
?>
<div id="main">
	<form class="admin" action="new_branch.php">
	<input type="hidden" name="id_prj" value="<?php 
echo $id_prj;