当前位置: 首页>>代码示例>>PHP>>正文


PHP Acl::get_entity方法代码示例

本文整理汇总了PHP中Acl::get_entity方法的典型用法代码示例。如果您正苦于以下问题:PHP Acl::get_entity方法的具体用法?PHP Acl::get_entity怎么用?PHP Acl::get_entity使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Acl的用法示例。


在下文中一共展示了Acl::get_entity方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: str_replace

     $file_path = "/usr/share/ossim/www/tmp/" . $result->fields["name"] . "_" . $scan_END . ".pdf";
     $file_path = str_replace(" ", "", $file_path);
     $file_name = $result->fields["name"] . "_" . $scan_END . ".pdf";
     $params = array($report_id, $file_path);
     Util::execute_command("/usr/bin/php /usr/share/ossim/scripts/vulnmeter/respdf.php ? > ?", $params);
     if (file_exists($file_path) && filesize($file_path) <= 5242880) {
         $attachments[] = array("path" => $file_path, "name" => $file_name);
     }
 }
 if (!valid_hex32($username)) {
     $body = get_timestamps($dbconn, $username, $result->fields['scan_START'], $result->fields['scan_SUBMIT'], $body);
     $email = get_email($dbconn, $username);
     Util::send_email($dbconn, $email, $subject, $body, $attachments);
 } else {
     // username is a entity
     $entity_data = Acl::get_entity($dbconn, $username, FALSE, FALSE);
     if ($entity_data["admin_user"] != "") {
         $body = get_timestamps($dbconn, $entity_data["admin_user"], $result->fields['scan_START'], $result->fields['scan_SUBMIT'], $body);
         $email = get_email($dbconn, $entity_data["admin_user"]);
         Util::send_email($dbconn, $email, $subject, $body, $attachments);
     } else {
         // doesn't exit pro admin
         $users_list = Acl::get_users_by_entity($dbconn, $username);
         foreach ($users_list as $k => $user_data) {
             if ($user_data['email'] != "") {
                 $body = get_timestamps($dbconn, $user_data['login'], $result->fields['scan_START'], $result->fields['scan_SUBMIT'], $body);
                 if ($user_data['email'] != '') {
                     Util::send_email($dbconn, $user_data['email'], $subject, $body, $attachments);
                 }
             }
         }
开发者ID:jackpf,项目名称:ossim-arc,代码行数:31,代码来源:send_notification.php

示例2: _

 $body = '<html>
 <head>
     <title>' . $subject . '</title>
 </head>
 <body>' . '<table width="100%" cellspacing="0" cellpadding="0" style="border:0px;">' . '<tr><td width="75">' . _('Id:') . '</td><td>' . $result->fields["id"] . '</td></tr>' . '<tr><td width="75">' . _('Title:') . '</td><td>' . $result->fields["title"] . '</td></tr>' . '<tr><td width="75">' . _('Date:') . '</td><td>' . $result->fields["date"] . '</td></tr>' . '<tr><td width="75">' . _('Ref:') . '</td><td>' . $result->fields["ref"] . '</td></tr>' . '<tr><td width="75">' . _('Type id:') . '</td><td>' . $result->fields["type_id"] . '</td></tr>' . '<tr><td width="75">' . _('Priority:') . '</td><td>' . $result->fields["priority"] . '</td></tr>' . '<tr><td width="75">' . _('Last update:') . '</td><td>' . $result->fields["last_update"] . '</td></tr>' . '<tr><td width="75">' . _('In charge:') . '</td><td>' . $in_charge . '</td></tr>' . '<tr><td width="75">' . _('Submitter:') . '</td><td>' . $result->fields["submitter"] . '</td></tr>' . '</table>' . '</body>
 </html>';
 if (!valid_hex32($result->fields["in_charge"])) {
     $user_data = Session::get_list($conn, "WHERE login='" . $result->fields["in_charge"] . "'", "", TRUE);
     if (is_object($user_data[0])) {
         if ($user_data[0]->get_email() != '') {
             Util::send_email($conn, $user_data[0]->get_email(), $subject, $body);
         }
     }
 } else {
     // In_charge is a entity
     $entity_data = Acl::get_entity($conn, $result->fields["in_charge"], FALSE, FALSE);
     if ($entity_data["admin_user"] != "") {
         // exists pro admin
         $pro_admin_data = Session::get_list($conn, "WHERE login='" . $entity_data["admin_user"] . "'", "", TRUE);
         if ($pro_admin_data[0]->get_email() != '') {
             Util::send_email($conn, $pro_admin_data[0]->get_email(), $subject, $body);
         }
     } else {
         // Doesn't exit pro admin
         $users_list = Acl::get_users_by_entity($conn, $result->fields["in_charge"]);
         foreach ($users_list as $user) {
             if ($user["email"] != '') {
                 Util::send_email($conn, $user['email'], $subject, $body);
             }
         }
     }
开发者ID:jackpf,项目名称:ossim-arc,代码行数:31,代码来源:check_tickets.php

示例3: _

 $text = _('Schedule Method') . ':' . " " . $value['schedule_name'] . " [" . $value['current_launch'] . "(UTC)]";
 $to_text = sprintf("\n%-20s", $text);
 echo $to_text;
 // Path to save PDF
 $dirUser = $uuid . '/' . $value['id'] . '/';
 $dirUserPdf = $urlPdf . '/' . $dirUser;
 newFolder($dirUserPdf);
 if ($value['save_in_repository'] == '0') {
     // Delete reports list
     clean(null, $dirUserPdf);
 }
 // Set name
 $str_to_replace = array(" ", ":", ".", "&");
 if (preg_match("/ENTITY\\:(\\d+)/", $value["assets"], $fnd)) {
     $conn = $db->connect();
     $entity = Acl::get_entity($conn, $fnd[1]);
     $assets = "ENTITY: " . $entity['name'];
     $db->close($conn);
 } else {
     $assets = $value['assets'];
 }
 $pdfNameEmail = str_replace($str_to_replace, "_", $value['name_report']) . "_" . str_replace($str_to_replace, "_", $assets);
 $subject_email = $value['name_report'] . " [" . $assets . "]";
 $pdfName = $pdfNameEmail . "_" . time();
 $text = _('Save to') . ':';
 $to_text = sprintf("\n%-16s", $text);
 $to_text .= $dirUserPdf . $pdfName . ".pdf\n";
 echo $to_text;
 // Customize parameters
 $params = 'scheduler=1&assets=' . $value['assets'];
 $params .= empty($value['date_range']) ? '&date_from=' . $value['date_from'] . '&date_to=' . $value['date_to'] . '&date_range=custom' : '&date_range=' . $value['date_range'];
开发者ID:jhbsz,项目名称:ossimTest,代码行数:31,代码来源:launcher.php

示例4: array

 if (preg_match("/^\\d+\$/", $result->fields["in_charge"])) {
     $entity_name_type = array();
     $entity_name_type = Acl::get_entity_name_type($dbconn, $result->fields["in_charge"]);
     $in_charge = $entity_name_type[0] . " [" . $entity_name_type[1] . "]";
 } else {
     $in_charge = $result->fields["in_charge"];
 }
 $email_data = array("id" => $result->fields["id"], "title" => $result->fields["title"], "date" => $result->fields["date"], "ref" => $result->fields["ref"], "type_id" => $result->fields["type_id"], "priority" => $result->fields["priority"], "last_update" => $result->fields["last_update"], "in_charge" => $in_charge, "submitter" => $result->fields["submitter"]);
 if (!preg_match("/^\\d+\$/", $result->fields["in_charge"])) {
     //in_charge is a user
     $user_data = Session::get_list($dbconn, "WHERE login='" . $result->fields["in_charge"] . "'");
     //echo $user_data[0]->get_email();
     sendEmail($conf, $email_data, $user_data[0]->get_email());
 } else {
     // in_charge is a entity
     $entity_data = Acl::get_entity($dbconn, $result->fields["in_charge"]);
     if ($entity_data["admin_user"] != "") {
         // exists pro admin
         $pro_admin_data = Session::get_list($dbconn, "WHERE login='" . $entity_data["admin_user"] . "'");
         //echo $pro_admin_data[0]->get_email();
         sendEmail($conf, $email_data, $pro_admin_data[0]->get_email());
     } else {
         // doesn't exit pro admin
         $users = Acl::get_users($dbconn);
         $user_list = $users[0];
         foreach ($user_list as $user) {
             if (in_array($result->fields["in_charge"], $user['entities'])) {
                 // send an e-mail to each user
                 //echo $user['email'];
                 sendEmail($conf, $email_data, $user['email']);
             }
开发者ID:jhbsz,项目名称:ossimTest,代码行数:31,代码来源:check_tickets.php

示例5:

        $color = "#D7DEE4";
    } else {
        $color = $i % 2 == 0 ? "#F2F2F2" : "#FFFFFF";
    }
    ?>
							<tr bgcolor="<?php 
    echo $color;
    ?>
">
								<td class="center nobborder"><?php 
    echo $date;
    ?>
</td>
								<?php 
    if (preg_match("/pro|demo/i", $version) && preg_match("/^\\d+/", $username)) {
        $entity = Acl::get_entity($conn, $username);
        $username = !empty($entity['name']) ? $entity['name'] : _("Unknown");
    }
    ?>
								
								<td class="center nobborder"><?php 
    echo $username;
    ?>
</td>
								
								<td class="left nobborder">
									<a href="repository_document.php?id_document=<?php 
    echo $id_doc;
    ?>
&maximized=1&search_bylink=<?php 
    echo $search_bylink;
开发者ID:jhbsz,项目名称:ossimTest,代码行数:31,代码来源:index.php

示例6: _

$body .= '<tr><td colspan="2">&nbsp;</td></tr>';
$body .= '<tr><td width="' . $width . '">' . _("Total:") . '</td><td>' . $total . '</td></tr>';
$body .= '<tr><td colspan="2">&nbsp;</td></tr>';
// show explanation
$body .= '<tr><td colspan="2">' . _("(+)(-)(=): Difference with previous detection for each host/vulnerability pair.") . '</td></tr>';
$body .= '</table>';
$body .= '</body>';
$body .= '</html>';
$email_data["body"] = $body;
if (!preg_match("/^\\d+\$/", $username)) {
    //username is a user
    $user_data = Session::get_list($dbconn, "WHERE login='" . $username . "'");
    sendEmail($conf, $email_data, $user_data[0]->get_email());
} else {
    // username is a entity
    $entity_data = Acl::get_entity($dbconn, $username);
    if ($entity_data["admin_user"] != "") {
        // exists pro admin
        $pro_admin_data = Session::get_list($dbconn, "WHERE login='" . $entity_data["admin_user"] . "'");
        sendEmail($conf, $email_data, $pro_admin_data[0]->get_email());
    } else {
        // doesn't exit pro admin
        $users = Acl::get_users($dbconn);
        $user_list = $users[0];
        foreach ($user_list as $user) {
            if (in_array($username, $user['entities'])) {
                // send an e-mail to each user
                sendEmail($conf, $email_data, $user['email']);
            }
        }
    }
开发者ID:jhbsz,项目名称:ossimTest,代码行数:31,代码来源:send_notification.php


注:本文中的Acl::get_entity方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。