-
Notifications
You must be signed in to change notification settings - Fork 0
/
actgravausuariosgrupo.php
60 lines (54 loc) · 1.06 KB
/
actgravausuariosgrupo.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<?php
//--utf8_encode --
session_start();
include_once 'cls/grupo.class.php';
include_once 'cls/permissao.class.php';
include_once 'cls/usuario.class.php';
include_once 'inc/comuns.inc.php';
include_once 'Image.class.php';
function Main()
{
header('Content-Type: text/html; charset=iso-8859-1');
$grupo = (isset($_POST["cg"]) && is_numeric($_POST["cg"])) ? $_POST["cg"] : 0;
$usuarios = (isset($_POST["u"])) ? $_POST["u"] : "";
$msg = "";
if ($grupo != 0)
{
if ($usuarios != "")
{
try
{
$g = new Grupo();
$g->setCodigo($grupo);
if ($g->DeletaTodosOsUsuarios())
{
$usuarios = split("-", $usuarios);
foreach($usuarios as $usuario)
{
$g->AdicionaUsuarioAoGrupo($usuario);
}
return "GRAVOU";
}
else
{
$msg = "@lng[Não consegui excluir]";
}
}
catch (Exception $ex)
{
throw new Exception($ex->getMessage(), $ex->getCode());
}
}
else
{
$msg = "@lng[Usuarios não informados]";
}
}
else
{
$msg = "@lng[Grupo não informado]";
}
echo(Comuns::Idioma($msg));
}
Main();
?>