Commit 9a0ee480 authored by jlopez's avatar jlopez
Browse files

Add & generate doc

parent 5600e10e
This diff is collapsed.
......@@ -330,7 +330,7 @@ require_once "./inc/php/buildHeader.php";
<script type="text/javascript">
function showFileContainer(id ) {
function showFileContainer(id) {
var value = FILE_CONTAINER[id];
document.getElementById('valueContainerFile').value = value;
......
......@@ -52,6 +52,11 @@ class DBquery
return mysqli_real_escape_string($this->dbh, $value);
}
/**
* Get all Distributions
*
* @return array
*/
public function getDistributions() {
$sql = "SELECT * FROM `Distrib` ORDER BY `Distrib`.`name` ASC;";
$result = mysqli_query($this->dbh, $sql);
......@@ -63,6 +68,14 @@ class DBquery
return $results;
}
/**
* Get distribution vname with name and version
*
* @param string $name The name of the distribution to find
* @param string $version The version of the distribution to find
*
* @return string
*/
public function getVName($name, $version) {
$sql = "SELECT vname FROM `Distrib` WHERE active = 1 AND `name`='$name' AND `version`='$version';";
$result = mysqli_query($this->dbh, $sql);
......@@ -72,6 +85,11 @@ class DBquery
return "";
}
/**
* Get all active distributions
*
* @return array
*/
public function getActiveDistributions() {
$sql = "SELECT * FROM `Distrib` WHERE active = 1 ORDER BY `Distrib`.`name` ASC;";
$result = mysqli_query($this->dbh, $sql);
......@@ -83,6 +101,11 @@ class DBquery
return $results;
}
/**
* Get all full name from all active distributions
*
* @return array
*/
public function getActiveDistributionsFullName() {
$sql = "SELECT name,version,vname FROM `Distrib` WHERE active = 1 ORDER BY `Distrib`.`name` ASC;";
$result = mysqli_query($this->dbh, $sql);
......@@ -93,6 +116,11 @@ class DBquery
return $results;
}
/**
* Get all managers
*
* @return array
*/
public function getManagers() {
$sql = "SELECT * FROM `Manager`;";
$result = mysqli_query($this->dbh, $sql);
......@@ -104,6 +132,11 @@ class DBquery
return $results;
}
/**
* Get all users
*
* @return array
*/
public function getUsers() {
$sql = "SELECT * FROM `User`;";
$result = mysqli_query($this->dbh, $sql);
......@@ -115,6 +148,13 @@ class DBquery
return $results;
}
/**
* Get grade with user login
*
* @param string $login The login of ther user
*
* @return array
*/
public function getGradeWithLogin($login) {
$sql = "SELECT * FROM `User` WHERE `login` = '$login';";
$result = mysqli_query($this->dbh, $sql);
......@@ -127,6 +167,13 @@ class DBquery
return $this->getLowerGrades();
}
/**
* Get all labels for specific grade
*
* @param $string $grade The grade to find the labels
*
* @return array
*/
public function getLabelsWithGrade($grade) {
$labels = $this->getLabels();
......@@ -146,6 +193,11 @@ class DBquery
return $results;
}
/**
* Get all grades
*
* @return array
*/
public function getGrades() {
$sql = "SELECT * FROM `Grade` ORDER BY `level` ASC;";
$result = mysqli_query($this->dbh, $sql);
......@@ -157,6 +209,11 @@ class DBquery
return $results;
}
/**
* Get all configs
*
* @return array
*/
public function getConfigs() {
$sql = "SELECT * FROM `Config` WHERE 1;";
$result = mysqli_query($this->dbh, $sql);
......@@ -168,6 +225,13 @@ class DBquery
return $results;
}
/**
* Gel all active config with type
*
* @param string $type The type of the config
*
* @return array
*/
public function getActiveConfigsWithType($type) {
$sql = "SELECT * FROM `Config` WHERE `type`='$type' AND `active` = 1;";
$result = mysqli_query($this->dbh, $sql);
......@@ -179,6 +243,13 @@ class DBquery
return $results;
}
/**
* Get grade with this ID
*
* @param int $ID The ID of the grade
*
* @return Grade
*/
public function getGradeWithId($ID) {
$sql = "SELECT * FROM `Grade` WHERE `ID` = '$ID';";
$result = mysqli_query($this->dbh, $sql);
......@@ -190,6 +261,11 @@ class DBquery
return $results;
}
/**
* Get lower grade
*
* @return Grade
*/
public function getLowerGrades() {
$sql = "SELECT * FROM `Grade` ORDER BY `level` DESC LIMIT 1;";
$result = mysqli_query($this->dbh, $sql);
......@@ -201,6 +277,11 @@ class DBquery
return $results;
}
/**
* Get max grade
*
* @return Grade
*/
public function getMaxGrades() {
$sql = "SELECT * FROM `Grade` ORDER BY `level` ASC LIMIT 1;";
$result = mysqli_query($this->dbh, $sql);
......@@ -211,7 +292,12 @@ class DBquery
}
return $results;
}
/**
* Get all public tags
*
* @return array
*/
public function getAllPublicTags() {
$sql = "SELECT tags FROM `Container` WHERE tags <> '' AND visibility = 1;";
$result = mysqli_query($this->dbh, $sql);
......@@ -222,6 +308,18 @@ class DBquery
return $results;
}
/**
* Get all containers
*
* @param string $type
* @param string $author
* @param array $labels
* @param array $tags
* @param string $description
*
* @return array
*
*/
public function getContainers($type, $author, $labels, $tags, $descriptions) {
$sql = "SELECT * FROM `Container`";
......@@ -277,6 +375,13 @@ class DBquery
return $results;
}
/**
* Get container with this id
*
* @param int $id The id of the container
*
* @return Container
*/
public function getContainerWithId($id) {
$sql = "SELECT * FROM `Container` WHERE `ID` = '$id';";
$result = mysqli_query($this->dbh, $sql);
......@@ -288,6 +393,11 @@ class DBquery
return $results;
}
/**
* Get all labels
*
* @return array
*/
public function getLabels() {
$sql = "SELECT * FROM `Label`;";
$result = mysqli_query($this->dbh, $sql);
......@@ -299,6 +409,14 @@ class DBquery
return $results;
}
/**
* Get label with this id
*
* @param int $id The id of the label
*
* @return Label
*
*/
public function getLabelsWithId($id) {
$sql = "SELECT * FROM `Label` WHERE `ID` = $id;";
$result = mysqli_query($this->dbh, $sql);
......@@ -310,12 +428,13 @@ class DBquery
return $results;
}
public function getMaxSectionArrangement() {
$sql = "SELECT MAX(arrangement) FROM `Section` WHERE `Section`.`parent` IS NULL;";
}
/**
* Get all labels for Container
*
* @param int $id The id of the container
*
* @return array
*/
public function getLabelWithContainerId($id) {
$sql = "SELECT * FROM `ContainerLabel` WHERE `containerId` = $id";
$result = mysqli_query($this->dbh, $sql);
......@@ -327,6 +446,11 @@ class DBquery
return $results;
}
/**
* Get all active Section who is parent
*
* @return array
*/
public function getAllActiveSectionParent() {
$sql = "SELECT * FROM `Section` WHERE `Section`.`parent` IS NULL AND active = 1 ORDER BY `Section`.`arrangement` ASC;";
$result = mysqli_query($this->dbh, $sql);
......@@ -338,6 +462,11 @@ class DBquery
return $results;
}
/**
* Get all section parent
*
* @return array
*/
public function getAllSectionParent() {
$sql = "SELECT * FROM `Section` WHERE `Section`.`parent` IS NULL ORDER BY `Section`.`arrangement` ASC;";
$result = mysqli_query($this->dbh, $sql);
......@@ -349,6 +478,13 @@ class DBquery
return $results;
}
/**
* Get all active Section for specific parent
*
* @param string $parent The name of the parent
*
* @return array
*/
public function getSectionWhithParent($parent) {
$sql = "SELECT * FROM `Section` WHERE `Section`.`parent` = '$parent' AND active = 1 ORDER BY `Section`.`arrangement` ASC;";
$result = mysqli_query($this->dbh, $sql);
......@@ -359,6 +495,12 @@ class DBquery
return $results;
}
/**
*
* Get all name of the section who have a parent
*
* @return array
*/
public function getNameSectionWhithParent($parent) {
$sql = "SELECT name FROM `Section` WHERE `Section`.`parent` = '$parent' AND active = 1 ORDER BY `Section`.`arrangement` ASC;";
$result = mysqli_query($this->dbh, $sql);
......@@ -369,6 +511,13 @@ class DBquery
return $results;
}
/**
* Get all Section for specific parent
*
* @param string $parent The name of the parent
*
* @return array
*/
public function getAllSectionWhithParent($parent) {
$sql = "SELECT * FROM `Section` WHERE `Section`.`parent` = '$parent' ORDER BY `Section`.`arrangement` ASC;";
$result = mysqli_query($this->dbh, $sql);
......@@ -380,6 +529,12 @@ class DBquery
return $results;
}
/**
* Get all action section
*
* @return array
*/
public function getActiveSection() {
$sql = "SELECT * FROM `Section` WHERE active = 1 ORDER BY `Section`.`arrangement` ASC;";
$result = mysqli_query($this->dbh, $sql);
......@@ -391,6 +546,11 @@ class DBquery
return $results;
}
/**
* Get all Section
*
* @return array
*/
public function getSection() {
$sql = "SELECT * FROM `Section` ORDER BY `Section`.`arrangement` ASC;";
$result = mysqli_query($this->dbh, $sql);
......@@ -402,6 +562,13 @@ class DBquery
return $results;
}
/**
* Get number packages For Distribution
*
* @deprecated
*
* @return int
*/
public function getNumberPackage($name) {
$sql = "SELECT COUNT(*) as number FROM `$name` WHERE 1 ";
......@@ -413,6 +580,11 @@ class DBquery
return 0;
}
/**
* Get all packages
*
* @deprecated
*/
public function getPackages($distrib, $filter, $patternName, $patternDescription, $limit) {
if($patternName and $patternDescription) {
$sql = "SELECT * FROM `$distrib` WHERE `name` LIKE '%$filter%' or `description` LIKE '%$filter%' ORDER BY CASE WHEN `name` LIKE '$filter' THEN 1 WHEN `name` LIKE '$filter%' THEN 2 WHEN `name` LIKE '%$filter' THEN 4 ELSE 3 END LIMIT $limit;";
......@@ -435,6 +607,12 @@ class DBquery
return $results;
}
/**
* Check if table exist in database
*
* @param string $name The name of the table
*
*/
public function checkTableExist($name) {
$sql = "SELECT count(*) as number FROM information_schema.TABLES WHERE (TABLE_SCHEMA = 'wicopa') AND (TABLE_NAME = '$name')";
......@@ -451,6 +629,9 @@ class DBquery
}
}
/**
* Create ofject in database
*/
public function create($object) {
$result = mysqli_query($this->dbh, $object->getInsert());
......@@ -464,7 +645,9 @@ class DBquery
}
/**
* Update ofject in database
*/
public function update($object) {
$result = mysqli_query($this->dbh, $object->getUpdate());
if($result) {
......@@ -476,6 +659,9 @@ class DBquery
}
/**
* Delete ofject in database
*/
public function delete($object) {
$result = mysqli_query($this->dbh, $object->getDelete());
if($result) {
......@@ -486,6 +672,9 @@ class DBquery
}
}
/**
* Check admin pass
*/
public function verifyPass($username, $pass) {
if($username == "admin" && Conf::dbEncodePass($pass)==Conf::$KK) {
return 1;
......@@ -499,6 +688,11 @@ class DBquery
}
}
/**
* Get number docker container
*
* @return int
*/
public function getNumberDockerContainer() {
$sql = 'SELECT count(*) as docker FROM `Container` WHERE type = "Docker" AND visibility = 1;';
$result = mysqli_query($this->dbh, $sql);
......@@ -513,6 +707,11 @@ class DBquery
return 0;
}
/**
* Get number singularity container
*
* @return int
*/
public function getNumberSingularityContainer() {
$sql = 'SELECT count(*) as singularity FROM `Container` WHERE type = "Singularity" AND visibility = 1';
$result = mysqli_query($this->dbh, $sql);
......
<?php
/**
* Connection to ldap
*/
require_once(__DIR__.'/../inc/conf/Conf.php');
/**
* Class LDAPquery for connection to the LDAP
*/
class LDAPquery {
var $ldaph = NULL;
/**
* Constructor
*/
public function __construct() {
$this->openConnection();
}
/**
* Open connection with LDAP
*/
public function openConnection() {
$this->ldaph = ldap_connect(Conf::$LDAP_HOSTNAME);
......@@ -22,12 +27,18 @@ class LDAPquery {
}
}
/**
* Bind with LDAP
*/
public function bind() {
ldap_set_option($this->ldaph, LDAP_OPT_PROTOCOL_VERSION, 3);
$r = ldap_bind($this->ldaph, Conf::$LDAP_ADMIN, Conf::$LDAP_PP);
return $r;
}
/**
* Verify user login and password with LDAP for user connection
*/
public function verifyPass($ul, $up) {
$r = $this->bind();
if($r) {
......
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Wicopa: Class List</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">Wicopa
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div class="header">
<div class="headertitle">
<div class="title">Class List</div> </div>
</div><!--header-->
<div class="contents">
<div class="textblock">Here are the classes, structs, unions and interfaces with brief descriptions:</div><div class="directory">
<div class="levels">[detail level <span onclick="javascript:toggleLevel(1);">1</span><span onclick="javascript:toggleLevel(2);">2</span>]</div><table class="directory">
<tr id="row_0_" class="even"><td class="entry"><span style="width:0px;display:inline-block;">&#160;</span><span id="arr_0_" class="arrow" onclick="toggleFolder('0_')">&#9660;</span><span class="icona"><span class="icon">N</span></span><b>packages</b></td><td class="desc"></td></tr>
<tr id="row_0_0_"><td class="entry"><span style="width:32px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classpackages_1_1Distrib.html" target="_self">Distrib</a></td><td class="desc"></td></tr>
<tr id="row_0_1_" class="even"><td class="entry"><span style="width:32px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classpackages_1_1Packages.html" target="_self">Packages</a></td><td class="desc"></td></tr>
<tr id="row_1_"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classConf.html" target="_self">Conf</a></td><td class="desc"></td></tr>
<tr id="row_2_" class="even"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classConfig.html" target="_self">Config</a></td><td class="desc"></td></tr>
<tr id="row_3_"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classContainer.html" target="_self">Container</a></td><td class="desc"></td></tr>
<tr id="row_4_" class="even"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classContainerLabel.html" target="_self">ContainerLabel</a></td><td class="desc"></td></tr>
<tr id="row_5_"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classDBquery.html" target="_self">DBquery</a></td><td class="desc"></td></tr>
<tr id="row_6_" class="even"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classDistribution.html" target="_self">Distribution</a></td><td class="desc"></td></tr>
<tr id="row_7_"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classGrade.html" target="_self">Grade</a></td><td class="desc"></td></tr>
<tr id="row_8_" class="even"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classLabel.html" target="_self">Label</a></td><td class="desc"></td></tr>
<tr id="row_9_"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classLDAPquery.html" target="_self">LDAPquery</a></td><td class="desc"></td></tr>
<tr id="row_10_" class="even"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classManager.html" target="_self">Manager</a></td><td class="desc"></td></tr>
<tr id="row_11_"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classModel.html" target="_self">Model</a></td><td class="desc"></td></tr>
<tr id="row_12_" class="even"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classPackage.html" target="_self">Package</a></td><td class="desc"></td></tr>
<tr id="row_13_"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classSection.html" target="_self">Section</a></td><td class="desc"></td></tr>
<tr id="row_14_" class="even"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classUser.html" target="_self">User</a></td><td class="desc"></td></tr>
</table>
</div><!-- directory -->
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.13
</small></address>
</body>
</html>
doc/bc_s.png

676 Bytes

doc/bdwn.png

147 Bytes

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Wicopa: Member List</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">