Example #1
0
function quotedAdminUserString()
{
    $adminUsers = getAdminUsers();
    $returnArray = array();
    foreach ($adminUsers as $user) {
        $returnArray[] = $user['email'];
    }
    return join(',', db_quotearray($returnArray));
}
Example #2
0
    $html = getAdminBans();
    include "templates/bans.php";
}
/*
* include users
* 
*/
if ($_REQUEST['option'] == 'users') {
    if ($_POST) {
        $result = updateAdminUsers($_POST);
    }
    $thisUser = '';
    if ($_POST['findUser']) {
        $thisUser = $_POST['findUser'];
    }
    $html = getAdminUsers($thisUser);
    include "templates/users.php";
}
/*
* include profiles
* 
*/
if ($_REQUEST['option'] == 'profiles') {
    if ($_POST) {
        $result = updateAdminProfiles($_POST);
    }
    $thisUser = '';
    if ($_POST['findUser']) {
        $thisUser = $_POST['findUser'];
    }
    $html = getAdminProfiles($thisUser);
Example #3
0
include_once '../lib/user.inc.php';
include_once '../lib/domains.inc.php';
requireDomainAdmin();
$query = $_POST['query'];
$mode = $_POST['mode'];
if ($query && !$mode && $query != 'all') {
    $userRows = getAdminUsers($query);
    if ($userRows) {
        $users = array('success' => TRUE, 'users' => $userRows);
        print json_encode($users);
    } else {
        print json_encode(array('success' => FALSE));
    }
} else {
    if ($mode == 'load' || $query == 'all') {
        $userRows = getAdminUsers();
        if ($userRows) {
            $users = array('success' => TRUE, 'users' => $userRows);
            print json_encode($users);
        } else {
            print json_encode(array('success' => FALSE));
        }
    } else {
        if ($mode == 'add') {
            $newUser = array('username' => $_POST['username'], 'domainId' => $_POST['domain'], 'pass' => $_POST['password'], 'repPass' => $_POST['reppassword'], 'name' => $_POST['name'], 'local' => $_POST['local'], 'active' => $_POST['active']);
            addUser($newUser);
        } else {
            if ($mode == 'resetPassword') {
                $user = $_POST['user'];
                $pass = $_POST['password'];
                $reppass = $_POST['password'];
Example #4
0
require "includes/dashboard_widget.php";
?>
            </div>
            
            <!-- Chart -->
            <div class="container row col-xs-12">
                <script type="text/javascript">
                    google.charts.load('current', {'packages':['bar']});
                    google.charts.setOnLoadCallback(drawChart);

                    function drawChart() {
                        var data = new google.visualization.arrayToDataTable([
                            ['Metric', 'Count'],
                            <?php 
$metrics = ['Published posts', 'Draft posts', 'Approved comments', 'Unapproved comments', 'Admin users', 'Other users', 'Categories'];
$counts = [count(getPublishedPosts()), count(getDraftPosts()), count(getApprovedComments()), count(getUnapprovedComments()), count(getAdminUsers()), count(getNoAdminUsers()), count(getAllCategories())];
for ($i = 0; $i < 7; $i++) {
    echo "['{$metrics[$i]}', {$counts[$i]}],";
}
?>
                        ]);

                        var options = {
                            title: '',
                            width: '100%',
                            height: '100%',
                            legend: { position: 'none' },
                            chart: { subtitle: '' },
                            axes: {
                                x: {
                                    0: { side: 'top', label: '' } // Top x-axis.
        if ($partner->getId() == PartnerPeer::GLOBAL_PARTNER) {
            KalturaLog::log('Skipping partner 0');
            continue;
        }
        $adminRoleId = $partner->getAdminSessionRoleId();
        $user->setRoleIds($adminRoleId);
        if (!$dryRun) {
            KalturaLog::log('Setting kuser id [' . $user->getId() . '] admin [' . $user->getIsAdmin() . '] with role id [' . $adminRoleId . ']');
            $user->save();
            // save
        } else {
            KalturaLog::log('DRY RUN ONLY - Setting kuser id [' . $user->getId() . '] admin [' . $user->getIsAdmin() . '] with role id [' . $adminRoleId . ']');
        }
        file_put_contents($lastUserFile, $lastUser);
    }
    $users = getAdminUsers($lastUser, $userLimitEachLoop);
}
$msg = 'Done - ' . ($dryRun ? 'DRY RUN!' : 'REAL RUN!');
KalturaLog::log($msg);
echo $msg;
function getAdminUsers($lastUser, $userLimitEachLoop)
{
    kuserPeer::clearInstancePool();
    UserRolePeer::clearInstancePool();
    $c = new Criteria();
    $c->addAnd(kuserPeer::ID, $lastUser, Criteria::GREATER_THAN);
    $c->addAnd(kuserPeer::IS_ADMIN, true, Criteria::EQUAL);
    $c->addAscendingOrderByColumn(kuserPeer::ID);
    $c->setLimit($userLimitEachLoop);
    kuserPeer::setUseCriteriaFilter(false);
    $users = kuserPeer::doSelect($c);
Example #6
0
*/
$PAGE = 'passwd';
require_once 'includes/pageaccess.inc.php';
require_once 'includes/session.inc.php';
require_once 'includes/misc_functions.inc.php';
function getAdminUsers()
{
    global $Auth;
    $users = $Auth->listUsers();
    $adminUsers = array();
    foreach ($users as $user) {
        $adminUsers[$user['username']] = $user['password'];
    }
    return $adminUsers;
}
$adminUsers = getAdminUsers();
$errors = array();
$success = array();
if (isset($_POST['changepasswordsubmit'])) {
    // Change Password
    if (isset($_POST['OldPassword']) && $_POST['OldPassword'] && isset($_POST['NewPassword']) && $_POST['NewPassword'] && isset($_POST['ConfirmPassword']) && $_POST['ConfirmPassword']) {
        if (!$Auth->storage->verifyPassword($_POST['OldPassword'], $adminUsers[$Auth->getUsername()])) {
            $errors[] = T_("Old Password incorrect");
        } elseif ($_POST['NewPassword'] != $_POST['ConfirmPassword']) {
            $errors[] = T_("New passwords don't match");
        } else {
            $Auth->changePassword($Auth->getUsername(), $_POST['NewPassword']) or $error_passwd = "Error Changing Password";
            // TODO: Check successful
            $success[] = T_("Password Changed");
            AdminLog::getInstance()->log(T_("Password Changed"));
        }