Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions etc/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,15 @@ final class Config {
# Enable authorization?
public static $ENABLE_AUTHZ = 1;
# Debug
#public static $DEBUG = TRUE;
public static $DEBUG = FALSE;
public static $DEBUG = TRUE;

# Directory, where to put the reports (only applied for asynchronous mode)
public static $REPORTS_DIR = "/var/tmp/pakiti-reports/";
# Should be report compressed?
public static $COMPRESS_REPORTS = 1;

# If CERN reports are used, path to the private key must be defined, in order to decrypt incomming report
public static $CERN_REPORT_DECRYPTION_KEY = "/etc/ssl/cert.pem";

# Do we want backup the reports
public static $BACKUP = TRUE;
Expand Down
5 changes: 2 additions & 3 deletions lib/common/Loader.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.

# Load the constants
require_once(realpath(dirname(__FILE__)) . '/Constants.php');

Expand Down Expand Up @@ -59,8 +58,8 @@ function __autoload($className) {
} elseif (preg_match('/.*Module$/', $className) > 0) {
# Get the module name
$moduleName = strtolower(preg_replace('/^(.*)Module$/','\1',$className));
if (file_exists(realpath(dirname(__FILE__)) . '/../modules/' . $moduleName . '/' . $className . '.php')) {
include_once(realpath(dirname(__FILE__)) . '/../modules/' . $moduleName . '/' . $className . '.php');
if (file_exists(realpath(dirname(__FILE__)) . '/../../modules/' . $moduleName . '/' . $className . '.php')) {
include_once(realpath(dirname(__FILE__)) . '/../../modules/' . $moduleName . '/' . $className . '.php');
}
} else {
# Models
Expand Down
20 changes: 11 additions & 9 deletions lib/dao/InstalledPkgDao.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,17 +91,19 @@ public function getInstalledPkgs(Host &$host, $orderBy, $pageSize, $pageNum) {
$installedPkgsDb =& $this->db->queryToMultiRow($sql);
# Create objects
$installedPkgs = array();
foreach ($installedPkgsDb as $installedPkgDb) {
$installedPkg = new InstalledPkg();
$installedPkg->setPkgId($installedPkgDb["pkgId"]);
$installedPkg->setHostId($installedPkgDb["hostId"]);
$installedPkg->setArchId($installedPkgDb["archId"]);
$installedPkg->setVersion($installedPkgDb["version"]);
$installedPkg->setRelease($installedPkgDb["release"]);
if ($installedPkgsDb != null) {
foreach ($installedPkgsDb as $installedPkgDb) {
$installedPkg = new InstalledPkg();
$installedPkg->setPkgId($installedPkgDb["pkgId"]);
$installedPkg->setHostId($installedPkgDb["hostId"]);
$installedPkg->setArchId($installedPkgDb["archId"]);
$installedPkg->setVersion($installedPkgDb["version"]);
$installedPkg->setRelease($installedPkgDb["release"]);

array_push($installedPkgs, $installedPkg);
array_push($installedPkgs, $installedPkg);
}
}

return $installedPkgs;
}

Expand Down
2 changes: 1 addition & 1 deletion lib/managers/DbManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ protected function rawSingleValueMultiRowFetch($res) {
* Single raw object fetch, just check if the fetch was successfull and return the result
*/
protected function rawSingleObjectFetch($res, $class, $params) {
if ($params == null) {
if ($params != null) {
if (($row = $res->fetch_object($class, $params)) == null) {
return null;
}
Expand Down
6 changes: 6 additions & 0 deletions lib/managers/ReportsManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,12 @@ public function createReport(Report &$report, Host &$host) {

$this->getPakiti()->getManager("DbManager")->query($sql);

# Assign the lastReportId to the host
$sql = "update Host set lastReportId=".$report->getId()." where id=".$host->getId();

$this->getPakiti()->getManager("DbManager")->query($sql);


return $report;
}

Expand Down
Loading