Exemple #1
0
 function delete() {
     Category::requirePermission("DELETE");
     $link = Database::getConnection();
     $query = "DELETE FROM category WHERE id=".Database::sqlValue($this->id);
     mysql_query($query) or die(Database::formatError($query, Text::getText("QueryFailed")));
     Database::returnConnection($link);
 }
Exemple #2
0
 function printContent() {
     ?>
       <table border="0">
         <tr bgcolor=<?=BGCOLOR_ALT?>>
           <th>#</th>
           <? if (SecurityGroup::havePermission("DELETE")) { ?>
             <th></th>
           <? } ?>
           <th><?=Text::getText("Name")?></th>
           <th>&nbsp;</th>
           <th>&nbsp;</th>
         </tr>
         <? $bg = TRUE; ?>
         <? foreach ($this->groups as $g) { ?>
           <? $bg = !$bg; ?>
           <tr<? if ($bg) { ?> bgcolor=<?=BGCOLOR_ALT?><? } ?>>
             <td>&nbsp;<?=$g->getId()?>&nbsp;</td>
             <? if (SecurityGroup::havePermission("DELETE")) { ?>
               <td><a href="<?=$this->groupDeletePage?>?<?=$this->groupDeleteParamGroupId?>=<?=$g->getId()?>" onClick="return confirm('<?=Text::getText('ConfirmDeleteGroup')?>')"><img src="<?=$this->imgDeleteSrc?>" border="0" alt="<?=Text::getText('Delete')?>"></a></td>
             <? } ?>
             <td>&nbsp;<a href="<?=$this->groupEditPage?>?<?=$this->groupEditParamGroupId?>=<?=$g->getId()?>"><?=$g->getName()?></a>&nbsp;</td>
             <td>&nbsp;<a href="<?=$this->groupMembersPage?>?<?=$this->groupMembersParamGroupId?>=<?=$g->getId()?>"><?=Text::getText("Members")?></a>&nbsp;</td>
             <td>&nbsp;<a href="<?=$this->groupPermissionsPage?>?<?=$this->groupPermissionsParamGroupId?>=<?=$g->getId()?>"><?=Text::getText("Permissions")?></a>&nbsp;</td>
           </tr>
         <? } ?>
       </table>
     <?
 }
Exemple #3
0
 function printContent() {
   $action = $this->getAction();
   ?>
     <form method="POST" action="<?=$action?>">
         <input type="hidden" name="action" value="save">
         <input type="hidden" name="submitted" value="yes">
         <table border="0" cellpadding="2">
             <tr>
                 <th><?=Text::getText("LoginName")?></th>
                 <td><input type="text" name="loginName" value=""></td>
             </tr>
             <tr>
                 <th><?=Text::getText("FullName")?></th>
                 <td><input type="text" name="fullName" value=""></td>
             </tr>
             <tr>
                 <th><?=Text::getText("Password")?></th>
                 <td><input type="password" name="password" value=""></td>
             </tr>
             <tr>
                 <td colspan="2" align="center">
                     <input type="submit" value="<?=Text::getText("Add")?>">
                 </td>
             </tr>
         </table>
     </form>
   <?
 }
Exemple #4
0
 function printContent() {
   ?>
     <table border="0">
       <tr bgcolor="<?=BGCOLOR_ALT?>">
         <th>#</th>
         <? if (SecurityUser::havePermission("DELETE")) { ?>
           <th></th>
         <? } ?>
         <th><?=Text::getText("FullName")?></th>
         <th><?=Text::getText("LoginName")?></th>
       </tr>
       <? $bg = TRUE; ?>
       <? foreach ($this->users as $u) { ?>
         <? $bg = !$bg; ?>
         <tr<? if ($bg) { ?> bgcolor="<?=BGCOLOR_ALT?>"<? } ?>>
           <td>&nbsp;<?=$u->getId()?>&nbsp;</td>
             <? if (SecurityUser::havePermission("DELETE")) { ?>
               <td><a href="<?=$this->userDeletePage?>?<?=$this->userDeleteUserParam?>=<?=$u->getId()?>" onClick="return confirm('<?=Text::getText('ConfirmDeleteUser')?>\n\n<?=$u->getLoginName()?>')"><img src="<?=IMAGE_TRASH?>" border="0" alt="<?=Text::getText('Delete')?>"></a></td>
             <? } ?>
             <td>&nbsp;<?=$u->getFullName()?>&nbsp;</td>
             <td>&nbsp;<a href="<?=$this->getUserPage()?>?id=<?=$u->getId()?>"><?=$u->getLoginName()?></a>&nbsp;</td>
         </tr>
       <? } ?>
     </table>
   <?
 }
Exemple #5
0
 /**
  * 
  */
 function getSubmitCaption()
 {
     if ($this->submitCaption == NULL) {
         return Text::getText("Submit");
     } else {
         return $this->submitCaption;
     }
 }
Exemple #6
0
 /**
  * Takes an INSERT query and returns the inserted ID,
  * or 0 if query does not generate an AUTO_INCREMENT
  * value.
  */
 function insert($sql) {
     $con = Database::getConnection();
     $result = mysql_query($sql) or die(Database::formatError($sql, Text::getText("QueryFailed")));
     $record = new DatabaseRecord($result);
     $id =  mysql_insert_id($con);
     Database::returnConnection($con);
     return $id;
 }
Exemple #7
0
 /**
  * __construct() should return text element if text is string
  */
 public function testConstruct_returnsElement_ifTextIsString()
 {
     $string = 'foo';
     $text = new Text($string);
     $this->assertTrue($text instanceof Text);
     $this->assertEquals($string, $text->getText());
     return;
 }
Exemple #8
0
 public function testFormattedTextRetrieve()
 {
     $string = "Hey %s, you have %d new messages";
     $arg1 = "Joe";
     $arg2 = 15;
     $compare = "Hey Joe, you have 15 new messages";
     $retrieved = Text::getText($string, $arg1, $arg2);
     self::assertSame($compare, (string) $retrieved);
 }
Exemple #9
0
 protected function writeText(Text $textChild, $level)
 {
     $newLine = $this->_pretty ? $this->_newLine : '';
     $indent = $this->_pretty ? str_repeat($this->_tabString, $level) : '';
     $text = $textChild->getText();
     //TODO: Need some kind of mb_wordwrap here, maybe:
     //http://stackoverflow.com/questions/3825226/multi-byte-safe-wordwrap-function-for-utf-8?
     return $this->_pretty && mb_strlen($text, 'utf-8') > $this->_textWrap ? $indent . wordwrap(str_replace("\n", '', $text), $this->_textWrap, "{$newLine}{$indent}") : $text;
 }
Exemple #10
0
 function update() {
     SecurityGroup::requirePermission("CHANGE");
     if ($this->id == NULL) {
         die(Text::getText("GroupHasNoId"));
     }
     $query = "UPDATE security_group";
     $query .= " SET name=".Database::sqlValue($this->name);
     $query .= " WHERE id=".Database::sqlValue($this->id);
     Database::query($query);
 }
Exemple #11
0
 function printContent() {
     $u = $this->getUser();
     ?>
       <form method="POST">
           <input type="hidden" name="action" value="save">
           <table border="0" cellpadding="2">
               <tr>
                   <td colspan="2" align="center">
                       <?=Text::getText("UserInfo")?>
                   </td>
               </tr>
               <tr>
                   <th><?=Text::getText("LoginName")?></th>
                   <td><input type="text" name="loginName" value="<?=$u->getLoginName()?>"></td>
               </tr>
               <tr>
                   <th><?=Text::getText("FullName")?></th>
                   <td><input type="text" name="fullName" value="<?=$u->getFullName()?>"></td>
               </tr>
               <tr>
                   <td colspan="2" align="center">
                       &nbsp;
                   </td>
               </tr>
               <tr>
                   <td colspan="2" align="center">
                       <input type="checkbox" name="changePassword" value="true">
                       <?=Text::getText("ChangePassword")?>
                   </td>
               </tr>
               <tr>
                   <th><?=Text::getText("NewPassword")?></th>
                   <td><input type="password" name="password" value=""></td>
               </tr>
               <tr>
                   <td colspan="2" align="center">
                       <input type="submit" value="<?=$this->getSubmitCaption()?>">
                       &nbsp;
                       <input type="button" value="<?=Text::getText('Cancel')?>" onClick="document.location='<?=$this->cancelPage?>'">
                   </td>
               </tr>
           </table>
       </form>
     <?
 }
Exemple #12
0
 function printContent() {
     ?>
       <form method="POST" action="<?=$this->getAction()?>">
           <input type="hidden" name="action" value="save">
           <table border="0" cellpadding="2">
               <tr>
                   <th><?=Text::getText("Name")?></th>
                   <td><input type="text" name="name" value=""></td>
               </tr>
               <tr>
                   <td colspan="2" align="center">
                       <input type="submit" value="<?=Text::getText("Add")?>">
                   </td>
               </tr>
           </table>
       </form>
     <?
 }
Exemple #13
0
 function printContent() {
     $g = $this->group;
     ?>    
       <form action="<?=$this->getAction()?>" method="POST">
           <input type="hidden" name="action" value="save">
           <table border="0" cellpadding="2">
               <tr>
                   <th><?=Text::getText("Name")?></th>
                   <td><input type="text" name="name" value="<?=$g->getName()?>"></td>
               </tr>
               <tr>
                   <td colspan="2" align="center">
                       <input type="submit" value="<?=Text::getText('Save')?>">
                       &nbsp;
                       <input type="button" value="<?=Text::getText('Cancel')?>" onClick="document.location='<?=$this->cancelPage?>'">
                   </td>
               </tr>
           </table>
       </form>
     <?
 }
 function printContent() {
     $g = $this->getGroup();
     $allPermissions = SecurityPermission::getAll();
     $allResources = SecurityResource::getAll();
     $msg = $this->getMessage();
     ?>
       <form action="<?=$this->getAction()?>" method="post">
         <input type="hidden" name="group" value="<?=$g->getId()?>">
         <? if (strlen($msg) > 0) { ?>
           <p><b><?=$msg?></b></p>
         <? } ?>
         <p>
         <table border="0">
           <tr>
             <td>
               <table border="0">
                 <tr bgcolor="<?=BGCOLOR_ALT?>">
                   <th><?=Text::getText("Resource")?></th>
                   <? foreach ($allPermissions as $perm) { ?>
                     <th><?=$perm->getName()?></th>
                   <? } ?>
                 </tr>
                 <? $bg = TRUE; ?>
                 <? foreach ($allResources as $res) { ?>
                   <? $bg = !$bg; ?>
                   <tr<? if ($bg) { ?> bgcolor="<?=BGCOLOR_ALT?>"<? } ?>>
                     <td><?=$res->getName()?></td>
                     <? foreach ($allPermissions as $perm) { ?>
                       <?
                         $checked = "";
                         if ($g->hasPermission($res, $perm)) {
                             $checked = " checked";
                         }
                       ?>
                       <td align="center"><input type="checkbox"<?=$checked?> name="res<?=$res->getId()?>_perm<?=$perm->getId()?>"></td>
                     <? } ?>
                   </tr>
                 <? } ?>
               </table>
             </td>
           </tr>
           <tr>
             <td align="center">
               <input type="submit" value="<?=Text::getText("Save")?>">
             </td>
           </tr>
         </table>
         </p>
       </form>
     <?
 }
Exemple #15
0
</h2>

<form method="POST">
    <input type="hidden" name="action" value="save">
    <table border="0" cellpadding="2">
        <tr>
            <th><?php 
echo Text::getText("Name");
?>
</th>
            <td><input type="text" name="name" value="<?php 
echo $g->getName();
?>
"></td>
        </tr>
        <tr>
            <td colspan="2" align="center">
                <input type="submit" value="<?php 
echo Text::getText("Save");
?>
">
                &nbsp;
                <input type="button" value="<?php 
echo Text::getText("Cancel");
?>
" onClick="document.location='groups.php'">
            </td>
        </tr>
    </table>
</form>
Exemple #16
0
if ($u == NULL) {
    $errMsg = Text::getText("MissingUser");
    include("error.php");
    exit;
}

if ($action == "save") {
    if (strlen($loginName) > 0) {
        $u->setLoginName($loginName);
        $u->setFullName($fullName);
        if ($changePassword == "true") {
            $u->setPassword($password);
        }
        $u->save();
        header("Location: users.php");
    } else {
        $errMsg = Text::getText("MissingLoginName");
        $buttonCaption = Text::getText("Save");
        include("header.php");
        include("userEditForm.php");
        include("footer.php");
    }
} else {
    $title = Text::getText("EditUser");
    $buttonCaption = Text::getText("Save");
    include("header.php");
    include("userEditForm.php");
    include("footer.php");
}
?>
Exemple #17
0
<? require_once("config.php"); ?>
<? require_once(RESACCMAN_BASE."/classes/SecurityUser.php"); ?>
<? require_once(RESACCMAN_BASE."/classes/Text.php"); ?>
<?
    $u = SecurityUser::getById($id);
    if ($u == NULL) {
        $errMsg = Text::getText("UserNotFound");
        $title = Text::getText("Delete");
        include("error.php");
    } else {
        $u->delete();
        header("Location: users.php");
    }
?>
Exemple #18
0
                success($user, $pageAfterLogin);
            }
        }
    } else if ($action == "remind") {
        $user = SecurityUser::getByLoginName($loginName);
        if ($user == NULL) {
            $errMsg = Text::getText("UserNotFound");
        } else {
            if ($user->getEmail() == "") {
                $errMsg = Text::getText("NoEmailSetInProfile");
            } else {
                $user->sendPasswordReset();
                $errMsg = str_replace('$email', $user->getEmail(), Text::getText("PasswordResetSent"));
            }
        }
    } else if ($_REQUEST['reset'] != null) {
        $resetKey = $_REQUEST['reset'];
        $user = SecurityUser::getByResetKey($resetKey);
        if ($user == NULL) {
            $errMsg = Text::getText("InvalidRequestKey");
        } else {
            $errMsg = Text::getText("EnterNewPassword");
            $form = "passwordResetForm.php";
        }
    }
    include("header.php");
    include($form);
    include("footer.php");
    
?>
Exemple #19
0
</table>

<? if (SecurityGroup::havePermission("ADD")) { ?>
    <h3><?php 
echo Text::getText("AddGroup");
?>
</h3>
    <form method="POST" action="groupAdd.php">
        <input type="hidden" name="action" value="save">
        <table border="0" cellpadding="2">
            <tr>
                <th><?php 
echo Text::getText("Name");
?>
</th>
                <td><input type="text" name="name" value=""></td>
            </tr>
            <tr>
                <td colspan="2" align="center">
                    <input type="submit" value="<?php 
echo Text::getText("Add");
?>
">
                </td>
            </tr>
        </table>
    </form>
<? } ?>

<? include("footer.php"); ?>
Exemple #20
0
            <? if (Recipe::havePermission("CHANGE")) { ?>
                <tr>
                    <td colspan="5">
                        <input type="submit" value="<?php 
echo Text::getText("Save");
?>
">
                    </td>
                </tr>
            <? } ?>
        </table>
        </p>
    </form>
<? } else { ?>
    <? if ($c == NULL) { ?>
        <?php 
echo Text::getText("NoRecipes");
?>
    <? } else { ?>
        <?php 
echo Text::getText("NoRecipesInCategory");
?>
    <? } ?>
<? } ?>
</p>
<div id="rss"><?php 
echo sprintf(Text::getText("ListAvailableInRSS"), '<a href="' . $rssUrl . '">RSS</a>');
?>
.</div>
<? include("footer.php"); ?>
Exemple #21
0
</a>&nbsp;
                </font>
            </td>
        </tr>
    <? } ?>
    <tr bgcolor="<?php 
echo $bgcolor;
?>
">
        <td align="center">
            <font size="<?php 
echo $fontSize;
?>
">
                &nbsp;<a href="login.php"><?php 
echo Text::getText("Login");
?>
</a>&nbsp;
            </font>
        </td>
    </tr>
    <tr bgcolor="#000000">
        <th align="center">
            <font color="<?php 
echo $color;
?>
" size="1">
                - - -
            </font>
        </th>
    </tr>
Exemple #22
0
<?php

require_once "config.php";
require_once RESACCMAN_BASE . "/classes/SecurityUser.php";
require_once RESACCMAN_BASE . "/classes/Text.php";
require_once RESACCMAN_BASE . "/classes/html/UserList.php";
require_once RESACCMAN_BASE . "/classes/html/UserAddForm.php";
include "header.php";
?>
<h2><?php 
echo Text::getText("Users");
?>
</h2><?

$allUsers = SecurityUser::getAll();
$list = new UserList($allUsers);
$list->printContent();

if (SecurityUSer::havePermission("ADD")) {
    $form = new UserAddForm();
    $form->printContent();
}

include("footer.php");

?>
Exemple #23
0
 /**
  * Static function that tries to log the specified user in.
  *
  * @return LoginResult
  */
 function login($username, $password)
 {
     if (strlen($username) > 0) {
         $user = SecurityUser::getByLoginName($username);
         if ($user == NULL) {
             return new LoginResult(FALSE, Text::getText("UserNotFound"));
         } else {
             if ($user->verifyPassword($password)) {
                 SecurityUser::setCurrent($user);
                 return new LoginResult(TRUE);
             } else {
                 return new LoginResult(FALSE, Text::getText("BadPassword"));
             }
         }
     } else {
         return new LoginResult(FALSE, Text::getText("NoUserSpecified"));
     }
 }
Exemple #24
0
    </div>


        </td>
    </tr>
    <tr>
        <th valign="top"><?php 
echo Text::getText("Picture");
?>
</th>
        <td><input type="file" name="photo"/></td>
    </tr>
    <tr>
        <td colspan="2" align="center">
            <?
                $label = Text::getText("Back");
                $recipeCat = $r->getCategory();
                if ($recipeCat != NULL) {
                    $label .= ": ".$recipeCat->getName();
                }
            ?>
            <input type="button" value="<?php 
echo $label;
?>
" onClick="document.location='./?cat=<?php 
echo $r->getCategoryId();
?>
#<?php 
echo $r->getId();
?>
'">
 function getUpdateMask()
 {
     $tNames = $this->LABELS;
     $colNames = $this->COLNAMES;
     array_push($colNames, "Aktion");
     array_push($tNames, " ");
     $table = new Table($tNames);
     if (count($this->COLSIZES) > 0) {
         $table->setColSizes($this->COLSIZES);
     }
     if (count($this->ALIGNMENTS) > 0) {
         $table->setAlignments($this->ALIGNMENTS);
     }
     if (isset($_REQUEST["showUpdateMask" . $this->TABLENAME]) && strlen($_REQUEST["showUpdateMask" . $this->TABLENAME]) > 0) {
         $r = $table->createRow();
         $r->setSpawnAll(true);
         $r->setAttribute(0, $this->getSingleUpdateMask($_REQUEST["showUpdateMask" . $this->TABLENAME]));
         $rX = $table->getRow(0);
         $table->setRow(0, $r);
         $table->addRow($rX);
         $table->addSpacer(0, 15);
     }
     $table->setHeadEnabled($this->HEAD_ENABLED);
     $table->setBackgroundColorChange(true);
     if ($this->isDeleteInUpdate()) {
         $this->doDeleteFromUpdatemask();
         for ($i = 0; $i < count($tNames); $i++) {
             if ($i != count($tNames) - 1) {
                 $tmpW[$i] = "";
             } else {
                 $tmpW[$i] = "125";
             }
         }
         $table->setColSizes($tmpW);
     }
     if ($this->WIDTH > 0) {
         $table->setWidth($this->WIDTH);
     }
     if ($this->HEIGHT > 0) {
         $table->setHeight($this->HEIGHT);
     }
     if ($this->BORDER != null && strlen($this->BORDER) > 0) {
         $table->setBorder($this->BORDER);
     }
     if ($this->PADDING >= 0) {
         $table->setPadding($this->PADDING);
     }
     if ($this->HEAD_ENABLED) {
         $table->setHeadEnabled($this->HEAD_ENABLED);
     }
     if ($this->SPACING >= 0) {
         $table->setSpacing($this->SPACING);
     }
     if ($this->XPOS > 0 && $this->YPOS > 0) {
         $table->setXPos($this->XPOS);
         $table->setYPos($this->YPOS);
     }
     //---------------------------------------------------
     // gesamte Tabelle einlesen um Feldtypen zu ermitteln
     //---------------------------------------------------
     $stmnt = "SELECT " . $this->COLNAMESTRING . " FROM " . $this->TABLENAME . " LIMIT 1 ";
     $result = $this->DBCONNECT->executeQuery($stmnt);
     //---------------------------------------------------
     // ROWS in Table aufnehmen
     //---------------------------------------------------
     $bgCtr = 1;
     for ($ir = 1; $ir <= count($this->ROWS); $ir++) {
         $r = $table->createRow();
         $r->setStyle("padding", "5px 5px");
         for ($ia = 0; $ia < count($this->COLNAMES); $ia++) {
             $row = $this->ROWS[$ir];
             $rowId = $this->ROWS[$ir]->getAttribute(count($this->COLNAMES));
             $val = "";
             $t = "";
             if (strlen($row->getAttribute($ia)) > 0) {
                 $val = getDbComboValue($this->TABLENAME, $this->COLNAMES[$ia], $row->getAttribute($ia), $row);
             }
             // Wenn DbCombo definiert wurde wird der passende Text zum Code der Spalte angezeigt
             if (strlen($val) > 0) {
                 $t = $val;
             } else {
                 $t = $row->getAttribute($ia);
             }
             $txt = new Text($t);
             if (mysql_field_type($result, $ia) == "blob") {
                 $txt = new Text("...");
                 $fn = mysql_field_name($result, $ia);
                 $txt->setToolTip("<b>" . $fn . ":</b> " . $t);
             } else {
                 if (mysql_field_type($result, $ia) == "date") {
                     $txt->setText($txt->getText());
                 } else {
                     //Maximal  ersten 30Stellen anzeigen
                     if (strlen($t) > 30) {
                         $tmp = $t;
                         if (strtolower($this->COLNAMES[$ia]) == "email") {
                             $tmp = "<a href='mailto:" . $t . "'>" . substr($t, 0, 30) . "..." . "</a>";
                         }
                         $txt->setFilter(false);
                         $txt->setText($tmp);
                         $txt->setToolTip($t);
                     } else {
                         $tmp = $t;
                         if (strtolower($this->COLNAMES[$ia]) == "email") {
                             $tmp = "<a href='mailto:" . $t . "'>" . $t . "</a>";
                         }
                         $txt->setFilter(false);
                         $txt->setText($tmp);
                     }
                 }
             }
             if (!$this->isInvisibleCol($this->COLNAMES[$ia])) {
                 $r->setAttribute($ia, $txt);
             } else {
                 $r->setAttribute($ia, " ");
             }
         }
         $tblBtns = new Table(array("", ""));
         $tblBtns->setWidth(150);
         $frmUpdBtn = new Form();
         $frmUpdBtn->add($this->DEFAULT_HIDDEN_FIELDS);
         $frmUpdBtn->add(new Hiddenfield("showUpdateMask" . $this->TABLENAME, $rowId));
         $frmUpdBtn->add(new Button("editEtage", "bearbeiten"));
         //bearbeiten Link
         $btnUpd = new Link($_SERVER['SCRIPT_NAME'] . "?" . "showUpdateMask" . $this->TABLENAME . "=" . $rowId, "bearbeiten");
         $btnUpd->setValidate(false);
         //$div->add($btnUpd);
         // entfernen Link einfügen
         $frmDelBtn = new Form();
         $frmDelBtn->add($this->DEFAULT_HIDDEN_FIELDS);
         $frmDelBtn->add(new Button("delete" . $rowId . $this->TABLENAME, "entfernen"));
         $rBtns = $tblBtns->createRow();
         $rBtns->setAttribute(0, $frmUpdBtn);
         if ($this->isDeleteInUpdate()) {
             $rBtns->setAttribute(1, $frmDelBtn);
         } else {
             $rBtns->setSpawnAll(true);
         }
         $tblBtns->addRow($rBtns);
         $r->setAttribute(count($tNames) - 1, $tblBtns);
         $table->addRow($r);
     }
     $form = new Form($_SERVER['SCRIPT_NAME']);
     $form->add($this->getPageNavigation());
     $form->add($table);
     $form->add($this->DEFAULT_HIDDEN_FIELDS);
     return $form;
 }
Exemple #26
0
<? require_once("classes/Recipe.php"); ?>
<? require_once("classes/Text.php"); ?>
<?
    $cat = $_POST['cat'];
    if (strlen($cat) == 0) {
        $recipes = Recipe::getAll();
    } else {
        if ($cat == "null") {
            $c = NULL;
        } else {
            $c = Category::getById($cat);
            if ($c == NULL) {
                $errMsg = Text::getText("CategoryNotFound").": ".$cat;
                include("error.php");
                exit;
            }
        }
        $recipes = Recipe::getInCategory($c);
    }
    
    $categories = Category::getAll();
    $catForId = array();
    foreach ($categories as $tempCat) {
        $catForId[$tempCat->getId()] = $tempCat;
    }
    
    foreach ($recipes as $r) {
        $fieldName = "cat".$r->getId();
        $newCatId = $_POST[$fieldName];
        //print "recipe ".$r->getId().": $newCatId<br>";
        if ($newCatId == "") {
Exemple #27
0
<? require_once("classes/Recipe.php"); ?>
<? require_once("classes/Text.php"); ?>
<?

$id = $_REQUEST['id'];
if ($id == "") {
    $all = Recipe::getAll();
} else {
    $r = Recipe::getById($id);
    if ($r == NULL) {
        $errMsg = Text::getText("RecipeNotFound");
        include("error.php");
        exit;
    }
    $all = array(Recipe::getById($id));
}
$hl = $_REQUEST['hl'];
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
 <head>
 <title>Steps</title>
 <link href="kupu/common/kupucontentstyles.css" rel="stylesheet" type="text/css" />
 <link href="steps.css" rel="stylesheet" type="text/css" />
 <meta http-equiv="Pragma" content="no-cache" />
 <meta http-equiv="Cache-Control" content="no-cache, must-revalidate" />
 <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
 </head>
<body>
<?php 
require_once "config.php";
require_once RESACCMAN_BASE . "/classes/Text.php";
require_once RESACCMAN_BASE . "/classes/html/GroupPermissionsForm.php";
$title = Text::getText("GroupPermissions");
if (GroupPermissionsForm::isSubmitted($_REQUEST)) {
    $g = GroupPermissionsForm::handle($_REQUEST);
    $today = date("r");
    header("Location: groupPermissions.php?id=" . $g->getId() . "&saved=" . $today);
} else {
    if (sizeof($_REQUEST['id']) > 0) {
        $g = SecurityGroup::getById($id);
    }
}
if ($g == NULL) {
    $errMsg = Text::getText("GroupNotFound") . ": '" . $id . "'";
    die($errMsg);
}
$title .= ": " . $g->getName();
$form = new GroupPermissionsForm($g);
if (strlen($_REQUEST['saved']) > 0) {
    $form->setMessage(IsatisText::getText("Saved") . ": " . $_REQUEST['saved']);
}
include "header.php";
?>
<h2><?php 
echo $title;
?>
</h2><?
$form->printContent();
include("footer.php");
Exemple #29
0
</a>
        <? if (Recipe::havePermission("CHANGE")) { ?>
            <a href="editkupu.php?id=<?php 
echo $r->getId();
?>
"><?php 
echo Text::getText("Edit");
?>
</a>
        <? } ?>
        <? if (Recipe::havePermission("DELETE")) { ?>
            <a href="delete.php?id=<?php 
echo $r->getId();
?>
" onClick="return confirm('<?php 
echo Text::getText("ConfirmDelete");
?>
')"><?php 
echo Text::getText("Delete");
?>
</a>
        <? } ?>
    </td>
</tr>
</table>
</p>

<? } ?>

<? include("footer.php"); ?>
Exemple #30
0
<?php

require_once "config.php";
require_once RESACCMAN_BASE . "/classes/SecurityGroup.php";
require_once RESACCMAN_BASE . "/classes/Text.php";
require_once RESACCMAN_BASE . "/classes/html/GroupAddForm.php";
require_once RESACCMAN_BASE . "/classes/html/GroupList.php";
include "header.php";
?>
<h2><?php 
echo Text::getText("Groups");
?>
</h2><?

$allGroups = SecurityGroup::getAll();
$list = new GroupList();
$list->setGroups($allGroups);
$list->printContent();

if (SecurityGroup::havePermission("ADD")) {
    $form = new GroupAddForm();
    $form->printContent();
}

include("footer.php");

?>