Example #1
0
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 projets</h1>

<p>
Voici la liste compl├Ęte des projets.
</p>

<?php 
$projs = project_get_all();
if (!count($projs)) {
    echo '<p><em>Il n\'y a pas de projet dans la base actuellement.</em></p>';
} else {
    echo '<table><tr><th>id_prj</th><th>name_prj</th><th>shortname</th><th>homepage</th><th>date_prj</th><th>description</th></tr>';
    foreach ($projs as $id_prj) {
        $prj = project_get_by_id($id_prj);
        echo '<tr><td>' . $id_prj . '</td><td>' . $prj->get_name_prj() . '</td><td>' . $prj->get_shortname() . '</td><td>' . $prj->get_url_prj() . '</td><td>' . $prj->get_date_prj() . '</td><td>' . $prj->get_desc_prj() . '</td></tr>';
        $admins = $prj->list_admins();
        echo "poof";
        foreach ($admins as $id_adm) {
            $adm = user_get_by_id($id_adm);
            echo '<tr><th>Admin</th><td colspan="5">' . $adm->get_name_user() . '</td></tr>';
        }
    }
    echo '</table>';
}
Example #2
0
        append_error('Invalid branch ID.');
        http_redir('/index.php');
    }
    $my_prj = project_get_by_id($my_branch->get_id_prj());
    if (!$my_prj) {
        append_error('Unable to fetch project information.');
        http_redir('/index.php');
    }
    $my_rel_id = $my_branch->get_last_release();
    if ($my_rel_id) {
        $my_rel = release_get_by_id($my_rel_id);
    }
    // c'est possible qu'il n'y ait pas de release
    $request = $my_branch;
} elseif (!empty($_GET['id_prj'])) {
    $my_prj = project_get_by_id($_GET['id_prj']);
    if (!$my_prj) {
        append_error('Invalid project ID.');
        http_redir('/index.php');
    }
    $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);
        }
    }
Example #3
0
header_box('Igoan :: The Free Directory Project');
flush_errors();
?>
<div id="main"><?php 
// these are the "stuff" section
login_box($me);
//categories_box();
?>
</div>

<div class="item soft">

<h2>Last project:</h2>

<ul>
<?php 
if ($result->numRows() == 0) {
    echo '<li>Sorry, no project in the database.</li>';
} else {
    for ($i = 0; $i < $result->numRows(); $i++) {
        $row = $result->fetchRow();
        $prj = project_get_by_id($row[0]);
        echo '<li><a href="/project/view.php?id_prj=' . $prj->get_id_prj() . '">' . $prj->get_name_prj() . '</a></li>';
    }
}
?>
</ul>
</div>
</div>
<?php 
footer_box();
Example #4
0
             http_redir('/project/view.php?id_branch=' . $branch->get_id_branch());
         }
     }
 } else {
     if (isset($_GET['id_rel'])) {
         # we add an author
         $id_rel = $_GET['id_rel'];
         $rel = release_get_by_id($id_rel);
         if (!$rel) {
             append_error_exit('Invalid release number #' . $id_release . '.');
         }
         $branch = branch_get_by_id($rel->get_id_branch());
         if (!$branch) {
             append_error_exit('Unable to fetch branch infos.');
         }
         $prj = project_get_by_id($branch->get_id_prj());
         if (!$prj) {
             append_error_exit('Unable to fetch project informations.');
         }
         if (!$branch->is_maintainer($me->get_id_user()) && !$prj->is_admin($me->get_id_user())) {
             append_error_exit('Sorry, you are not a maintainer for this project.');
         }
         // ACTION
         if (isset($login)) {
             if (!$login) {
                 append_error('Login "' . $_GET['login'] . '" doesn\'t exist.');
             } else {
                 $rel->add_author($login->get_id_user());
                 http_redir('/project/view.php?id_rel=' . $rel->get_id_rel());
             }
         } else {
function login_box()
{
    $me = user_get_by_id($_SESSION['id']);
    ?>
	<div class="stuff">
	<div class="login"><?php 
    if ($me) {
        ?>
		<h4> Logged as <?php 
        echo $me->get_login();
        ?>
 </h4>
	<div class="loggued">
		<p>
			<a href="<?php 
        echo REMOTE_PATH;
        ?>
/user/view.php" title="Go to my personal page">My personal page</a><br />
			<a href="<?php 
        echo REMOTE_PATH;
        ?>
/user/edit.php" title="Edit my own informations">Edit my infos</a><br />
			<!-- <a href="<?php 
        echo REMOTE_PATH;
        ?>
/user/logout.php?referer=<?php 
        echo htmlentities(urlencode($_SERVER['REQUEST_URI']));
        ?>
" title="Logout">Logout</a><br /> -->
			<a href="<?php 
        echo REMOTE_PATH;
        ?>
/user/logout.php" title="Logout">Logout</a><br />
		</p><?php 
        $projects_id = $me->list_projects();
        if ($projects_id) {
            $my_projects = '<h5> My projects: </h5><ul>';
            foreach ($projects_id as $id_prj) {
                $prj = project_get_by_id($id_prj);
                if (!$prj) {
                    continue;
                }
                $my_projects .= '<li><a href="' . REMOTE_PATH . '/project/view.php?id_prj=' . $prj->get_id_prj() . '">' . $prj->get_name_prj() . '</a><br />';
                $my_projects .= '</li>';
            }
            echo $my_projects . '</ul>';
        }
        ?>
<!--	<h5> My projects: </h5>
		<ul>
			<li> <a href="#">Arkhart</a><br />
			<ul>
			<li><a href="#">Add a branch</a></li>
			<li><a href="#">Add a release</a></li>
			</ul>
			</li>
			<li> <a href="#">Igoan</a><br />
			<ul>
			<li><a href="#">Add a release</a></li>
			</ul>
			</li>
		</ul> -->
		<p>
			<a href="<?php 
        echo REMOTE_PATH;
        ?>
/project/new_project.php" title="Register a new project">New project</a>
		</p>
	</div><?php 
    } else {
        ?>
	<h4> Login: </h4>
	<form action="<?php 
        echo REMOTE_PATH;
        ?>
/user/login.php">
	<div>
		<label for="username"> Username: </label><br />
		<input title="Your igoan user name." id="username" name="login" type="text" /><br />
		<label for="password"> Password: </label><br />
		<input title="Your igoan user password." id="password" name="passwd" type="password" /><br />
		<input type="submit" style="margin-top: 0.2em" name="submit" value="Submit !" />
		<input type="hidden" name="referer" value="<?php 
        echo $_SERVER['REQUEST_URI'];
        ?>
" />
	</div>
	</form>
	<h4><small><a href="<?php 
        echo REMOTE_PATH;
        ?>
/user/new.php">Register</a></small></h4>
<?php 
    }
    ?>
		</div>
	<br style="clear: both;" />
<?php 
}
Example #6
0
        }
    }
    $d_mybranches = '<div class="historique"><dl><dt> Branches maintained by ' . $requested->get_name_user() . ': </dt>' . '<dd><table><thead><tr><th class="short"> Project name </th><th class="short"> Branch name </th>' . '<th class="short"> Last version </th><th class="short"> Last update </th></tr></thead><tbody>' . $d_mybranches . '</tbody></table></dd></dl></div>';
}
// LIST OF CONTRIBUTED RELEASES (those the user appears as an author)
$d_myrel = '';
$list = $requested->list_releases();
if ($list) {
    foreach ($list as $tmpid) {
        $rel = release_get_by_id($tmpid);
        if ($rel) {
            $version = $rel->get_name_rel();
            $date = $rel->get_date_rel();
            $b = branch_get_by_id($tmp->get_id_branch());
            if ($b) {
                $prj = project_get_by_id($b->get_id_prj());
                if ($prj) {
                    $d_myrel .= '<tr><td><a href="/project/view.php?id_rel=' . $rel->get_id_rel() . '">' . $prj->get_name_prj() . ' (' . $b->get_name_branch() . ') ' . $version . '</a></td><td>' . $date . '</td></tr>';
                }
            }
        }
    }
    $d_myrel = '<div class="historique"><dl><dt> Releases contributed by ' . $requested->get_name_user() . ': </dt>' . '<dd><table><thead><tr><th class="short"> Complete release name </th>' . '<th class="short"> Release date </th></tr></thead><tbody>' . $d_myrel . '</tbody></table></dd></dl></div>';
}
// Apres les entetes, on affiche les erreurs
if (errors()) {
    flush_errors_exit();
}
// un chti flag
if ($_SESSION['id'] == $requested->get_id_user()) {
    $myself = true;