Пример #1
0
function newPerson($complete_sess_id, $account_id, $name, $comments, $email, $dep_id, $url, $password, $category)
{
    if (!Validate_Session($complete_sess_id, $_SERVER['REMOTE_ADDR'], $GLOBALS['bd'])) {
        return "Invalid session ID!";
    }
    /* XXX There must have one '0' for each public type defined on config.inc.php */
    Insert_Person($account_id, $name, $comments, $email, $dep_id, $url, $password, $category, 00, $GLOBALS['bd']);
    return 1;
}
        }
        switch (User_Validate_Simple_Field($people[0][6], 100)) {
            case -2:
                $error[$num_errors++] = "There are invalid characteres at the url";
                break;
        }
        if (empty($error)) {
            srand((double) microtime() * 1000000);
            $password = rand(00, 999999);
            $passwordmd5 = md5($password);
            $id = $people[0][0];
            $name = $people[0][1];
            $adm_address = $cfg['admin_email'];
            $url = $cfg['url'];
            mail($people[0][5], "Your Account At No Risk Planning", "An Account at No Risk Planning has been created to you.\n\nYour ID and password are just below: \n\n ID: {$id}\n Password: {$password}\n\n\nTo get into the system enter {$url}.", "From: No Risk Planning <{$adm_address}>");
            Insert_Person($people[0][0], $people[0][1], $people[0][2], $people[0][5], $people[0][3], $people[0][6], $passwordmd5, $people[0][8], $people[0][7], $bd);
            $alert[$num_alerts++] = "New Person Inserted Successfully";
            include "adm_acc_people.php";
            exit;
        }
    }
    $departments = List_Departments('', '', '', $bd);
    $categories = List_Categories('', '', $bd);
    $result_xsl = "xsl/" . $default_xsl . "/adm_acc_people_new.xsl";
} else {
    $error[$num_errors++] = "Invalid Session ID";
    include "logout.php";
    exit;
}
$smarty->assign("nrpTransform", $result_xsl);
$smarty->assign("nrpSchErrors", $error);