public function testSetStatus() { $u = new ae_UserModel(); $this->assertTrue(ae_UserModel::isValidStatus($u->getStatus())); $u->setStatus(ae_UserModel::STATUS_ACTIVE); $this->assertEquals($u->getStatus(), ae_UserModel::STATUS_ACTIVE); $this->setExpectedException('Exception'); $u->setStatus(TRUE); }
} else { if (isset($_GET['user']) && ae_Validate::id($_GET['user'])) { $area = 'user'; $model = new ae_UserModel(); } else { header('Location: ../admin.php?error=unknown_area_or_invalid_id'); exit; } } } } } } } $model->load($_GET[$area]); $prevStatus = $model->getStatus(); if ($_GET['status'] == 'delete') { if (!$model->delete()) { header('Location: ../admin.php?area=' . $mainArea . '&' . $area . '&status=' . $prevStatus . '&error=delete'); exit; } header('Location: ../admin.php?area=' . $mainArea . '&' . $area . '&status=' . $prevStatus . '&success=delete'); exit; } else { try { $model->setStatus($_GET['status']); } catch (Exception $e) { header('Location: ../admin.php?area=' . $mainArea . '&' . $area . '&status=' . $prevStatus . '&error=invalid_status'); exit; } if (!$model->save()) {
<?php $actions = array(ae_CommentfilterModel::ACTION_SPAM => 'Move to spam', ae_CommentfilterModel::ACTION_TRASH => 'Move to trash', ae_CommentfilterModel::ACTION_DROP => 'Drop comment', ae_CommentfilterModel::ACTION_APPROVE => 'Approve comment', ae_CommentfilterModel::ACTION_UNAPPROVE => 'Unapprove comment'); $targets = array(ae_CommentfilterModel::TARGET_IP => 'Author IP', ae_CommentfilterModel::TARGET_NAME => 'Author name', ae_CommentfilterModel::TARGET_EMAIL => 'Author eMail', ae_CommentfilterModel::TARGET_URL => 'Author URL', ae_CommentfilterModel::TARGET_USERID => 'Author user ID', ae_CommentfilterModel::TARGET_CONTENT => 'Comment content'); $statuses = ae_CommentfilterModel::listStatuses(); ?> <aside> <div class="input-group"> <h3>Status</h3> <select name="cf-status"> <?php foreach ($statuses as $s) { ?> <?php $sel = $s == $model->getStatus() ? ' selected' : ''; ?> <option value="<?php echo htmlspecialchars($s); ?> "<?php echo $sel; ?> ><?php echo $s; ?> </option> <?php } ?> </select>