Newer
Older
if(!defined('OSTADMININC') || !$thisstaff || !$thisstaff->isAdmin()) die('Access Denied');
$submit_text=__('Save Changes');
Peter Rotich
committed
$info=$api->getHashtable();
$info['isactive']=isset($info['isactive'])?$info['isactive']:1;
}
$info=Format::htmlchars(($errors && $_POST)?$_POST:$info);
?>
<form action="apikeys.php?<?php echo Http::build_query($qs); ?>" method="post" id="save">
<input type="hidden" name="do" value="<?php echo $action; ?>">
<input type="hidden" name="a" value="<?php echo Format::htmlchars($_REQUEST['a']); ?>">
<input type="hidden" name="id" value="<?php echo $info['id']; ?>">
<h2><?php echo __('API Key');?>
<i class="help-tip icon-question-sign" href="#api_key"></i>
</h2>
<table class="form_table" width="940" border="0" cellspacing="0" cellpadding="2">
<thead>
<tr>
<th colspan="2">
<h4><?php echo $title; ?></h4>
<em><?php echo __('API Key is auto-generated. Delete and re-add to change the key.');?></em>
Peter Rotich
committed
<td width="150" class="required">
<input type="radio" name="isactive" value="1" <?php echo $info['isactive']?'checked="checked"':''; ?>><strong><?php echo __('Active');?></strong>
<input type="radio" name="isactive" value="0" <?php echo !$info['isactive']?'checked="checked"':''; ?>><?php echo __('Disabled');?>
<span class="error">* </span>
</td>
</tr>
<?php if($api){ ?>
<tr>
Peter Rotich
committed
<td width="150">
<i class="help-tip icon-question-sign" href="#ip_addr"></i>
</span>
Peter Rotich
committed
<td width="150">
Peter Rotich
committed
<td><?php echo $api->getKey(); ?> </td>
Peter Rotich
committed
<td width="150" class="required">
<input type="text" size="30" name="ipaddr" value="<?php echo $info['ipaddr']; ?>">
<span class="error">* <?php echo $errors['ipaddr']; ?></span>
<i class="help-tip icon-question-sign" href="#ip_addr"></i>
</span>
</td>
</tr>
<?php } ?>
<tr>
<th colspan="2">
<em><strong><?php echo __('Services');?>:</strong> <?php echo __('Check applicable API services enabled for the key.');?></em>
Peter Rotich
committed
<td colspan=2 style="padding-left:5px">
<label>
<input type="checkbox" name="can_create_tickets" value="1" <?php echo $info['can_create_tickets']?'checked="checked"':''; ?> >
<?php echo __('Can Create Tickets <em>(XML/JSON/EMAIL)</em>');?>
</label>
</td>
</tr>
<tr>
<td colspan=2 style="padding-left:5px">
<label>
<input type="checkbox" name="can_exec_cron" value="1" <?php echo $info['can_exec_cron']?'checked="checked"':''; ?> >
<?php echo __('Can Execute Cron');?>
<em><strong><?php echo __('Admin Notes');?></strong>: <?php echo __('Internal notes.');?> </em>
<textarea class="richtext no-bar" name="notes" cols="21"
rows="8" style="width: 80%;"><?php echo $info['notes']; ?></textarea>
</td>
</tr>
</tbody>
</table>
<p style="padding-left:225px;">
<input type="submit" name="submit" value="<?php echo $submit_text; ?>">
<input type="reset" name="reset" value="<?php echo __('Reset');?>">
<input type="button" name="cancel" value="<?php echo __('Cancel');?>" onclick='window.location.href="apikeys.php"'>