Example #1
0
function addBundleRights($bundleDefinition, $aclProvider, $securityIdentity, $application)
{
    if (!array_key_exists('resources', $bundleDefinition) || !array_key_exists('actions', $bundleDefinition)) {
        return;
    }
    $actions = getActions($bundleDefinition['actions']);
    if (0 === count($actions)) {
        return [];
    }
    if (is_array($bundleDefinition['resources'])) {
        foreach ($bundleDefinition['resources'] as $bundleName) {
            if (null !== ($bundle = $application->getBundle($bundleName))) {
                addObjectAcl($bundle, $aclProvider, $securityIdentity, $actions);
            }
        }
    } elseif ('all' === $bundleDefinition['resources']) {
        foreach ($application->getBundles() as $bundle) {
            addObjectAcl($bundle, $aclProvider, $securityIdentity, $actions);
        }
    }
}
      <th>Phone Number</th>
      <th>Department Name</th>
      <th>Manager ID</th>
      <th>Street Address</th>
      <th>Job Title</th>
      <th>Actions</th>
    </tr>
  </thead>
  <tbody>';
    while ($row = $result->fetch_assoc()) {
        if ($row["JOB_TITLE"] != "") {
            $jobTitle = $row["JOB_TITLE"];
        } else {
            $jobTitle = "N/A";
        }
        printf("<tr><td>%d</td><td>%s</td> <td>%s</td> <td>%s</td> <td>%s</td> <td>%d</td> <td>%s</td> <td>%s</td> <td>%s</td></tr>", $row["EMPLOYEE_ID"], $row["LAST_NAME"], $row["FIRST_NAME"], $row["PHONE_NUMBER"], $row["DEPARTMENT_NAME"], $row["MANAGER_ID"], $row["STREET_ADDRESS"], $jobTitle, getActions($access, $row['EMPLOYEE_ID']));
    }
    echo '</tbody></table>';
    if ($result->num_rows == 0) {
        echo "<h2>0 results </h2>";
    }
} else {
    echo "<h2><small>No Entries Found</small></h2>";
}
$conn->close();
require 'footer.php';
?>
	


Example #3
0
<?php

include "domotix.cfg";
include "domotix.lib.php";
// Recherche des actions à réaliser sur les matériels
// indiqués dans la table 'planning' de la base de données
// pour le critère jour heure minute du moment
while (true) {
    $tabActions = getActions();
    foreach ($tabActions as $ligne) {
        logMe("SRV : Materiel : {$ligne}");
        list($materiel, $action) = explode("&", $ligne);
        $res = executer($materiel, $action);
        $ret = majStatus($materiel, $action);
    }
    sleep(20);
}
Example #4
0
function getNumberOfActions()
{
    // Get the number of pending  actions
    // Argument:
    //  none
    // Return:
    //  n: integer count of all actions (next and regular) that are
    //  pending.
    $result = getActions();
    $ntotal = $result['n'];
    $result = getCompletedNextActions();
    $ncomp = $result['n'];
    $npending = $ntotal - $ncomp;
    return $npending;
}