* Created tool to manage users
* Added the sent of an e-mail to all involved members, when a project is commited
Esse commit está contido em:
@@ -10,6 +10,7 @@
|
||||
//$_MIND['updateSource'] = 'http://localhost/thewebmind.org/latest/current.xml';
|
||||
$_MIND['wmlVersion'] = Array();
|
||||
$_MIND['wmlVersion']['1.0'] = '<?wml version="1.0"?>';
|
||||
$_MIND['logDirectory'] = 'logs';
|
||||
$_MIND['cryptKey'] = 'theWebMind';
|
||||
$_MIND['header'] = 'components/header.php'; // the header to be loaded in each file
|
||||
$_MIND['components'] = 'components'; // the Mind components directory
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/**
|
||||
* Classe responsável pela lógica para o MySQL
|
||||
* Classe respons�vel pela l�gica para o MySQL
|
||||
*
|
||||
* @link www.thewebmind.org
|
||||
* @version 1.0
|
||||
@@ -43,9 +43,25 @@
|
||||
public function getAcronymPDO(){
|
||||
return "mysql";
|
||||
}
|
||||
/**
|
||||
* Gets how to select the schema
|
||||
* @name selectSchema
|
||||
* @return String
|
||||
*/
|
||||
public function selectSchema($schemaName){
|
||||
return "";
|
||||
}
|
||||
|
||||
/**
|
||||
* Remover todas as constraints realcionadas à tabela recebida, e entao rmover a tabela
|
||||
* Selects the schema
|
||||
* @name selectCurrentSchema
|
||||
* @return resource
|
||||
*/
|
||||
public function selectCurrentSchema($dbConn, $schemaName){
|
||||
return true;
|
||||
}
|
||||
/**
|
||||
* Remover todas as constraints realcionadas � tabela recebida, e entao rmover a tabela
|
||||
* @return String
|
||||
*/
|
||||
public function removeTable($dbConn, $tableName){
|
||||
@@ -71,7 +87,7 @@
|
||||
/**
|
||||
* Recupera o ultimo erro
|
||||
*
|
||||
* @param Object $dbConn Conexão
|
||||
* @param Object $dbConn Conex�o
|
||||
* @return String Erro
|
||||
*/
|
||||
function getLastError($dbConn){
|
||||
@@ -81,7 +97,7 @@
|
||||
/**
|
||||
* Conecta a base de dados
|
||||
*
|
||||
* @param Object $ob Objeto com os dados para conexão
|
||||
* @param Object $ob Objeto com os dados para conex�o
|
||||
* @return Object Resource
|
||||
*/
|
||||
function connectTo($ob){
|
||||
@@ -102,7 +118,7 @@
|
||||
/**
|
||||
* Desconecta
|
||||
*
|
||||
* @param Object $dbCon Conexão
|
||||
* @param Object $dbCon Conex�o
|
||||
* @return Object Resource
|
||||
*/
|
||||
function disconnectFrom($dbCon){
|
||||
@@ -113,7 +129,7 @@
|
||||
/**
|
||||
* Verifica se uma tabela existe
|
||||
*
|
||||
* @param Object $dbCon Conexão
|
||||
* @param Object $dbCon Conex�o
|
||||
* @param String $table Nome da tabela
|
||||
* @return Boolean
|
||||
*/
|
||||
@@ -125,7 +141,7 @@
|
||||
/**
|
||||
* Retorna os campos da tabela
|
||||
*
|
||||
* @param Object $dbCon Conexão
|
||||
* @param Object $dbCon Conex�o
|
||||
* @param String $table Nome da tabela
|
||||
* @return ObjectCollection of fields
|
||||
*/
|
||||
@@ -142,7 +158,7 @@
|
||||
}
|
||||
|
||||
/**
|
||||
* Escreve o cabeçalho do arquivo SQL
|
||||
* Escreve o cabe�alho do arquivo SQL
|
||||
* @return String Header
|
||||
*/
|
||||
public function getHeader(){
|
||||
@@ -155,8 +171,8 @@
|
||||
}
|
||||
|
||||
/**
|
||||
* Escreve a função para conexão com o MySQL
|
||||
* @return String Função connectToMySQL()
|
||||
* Escreve a fun��o para conex�o com o MySQL
|
||||
* @return String Fun��o connectToMySQL()
|
||||
*/
|
||||
public function establishConnection()
|
||||
{
|
||||
@@ -173,7 +189,7 @@
|
||||
/**
|
||||
* Executa uma Query
|
||||
*
|
||||
* @param Object $dbCon Conexão
|
||||
* @param Object $dbCon Conex�o
|
||||
* @param String $qr Query
|
||||
* @return Object Resource
|
||||
*/
|
||||
@@ -182,7 +198,7 @@
|
||||
}
|
||||
|
||||
/**
|
||||
* Fecha uma conexão
|
||||
* Fecha uma conex�o
|
||||
* @return String Close
|
||||
*/
|
||||
public function closeConnection(){
|
||||
@@ -248,7 +264,7 @@
|
||||
}
|
||||
|
||||
/**
|
||||
* Define um valor padrão
|
||||
* Define um valor padr�o
|
||||
* @return String default
|
||||
*/
|
||||
public function setDefaultValue(){
|
||||
@@ -264,7 +280,7 @@
|
||||
}
|
||||
|
||||
/*
|
||||
AINDA NÃO SUPORTADO
|
||||
AINDA N�O SUPORTADO
|
||||
*/
|
||||
public function createFieldComment(){}
|
||||
|
||||
@@ -294,8 +310,8 @@
|
||||
}
|
||||
|
||||
/**
|
||||
* Primary Key padrão
|
||||
* @return String para Primary Key padrão
|
||||
* Primary Key padr�o
|
||||
* @return String para Primary Key padr�o
|
||||
*/
|
||||
public function defaultPrimaryKey(){
|
||||
return "<element><fieldname></element> integer <obj>auto_increment</obj> <obj>unique</obj> <obj>not null</obj>";
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/**
|
||||
* Classe responsável pela lógica para o PostgreSQL
|
||||
* Classe respons�vel pela l�gica para o PostgreSQL
|
||||
*
|
||||
* @link www.thewebmind.org
|
||||
* @version 1.0
|
||||
@@ -14,8 +14,8 @@
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->attType= Array();
|
||||
$this->defaultPort= '5432';
|
||||
$this->attType = Array();
|
||||
$this->defaultPort = '5432';
|
||||
$this->attType['key'] = "int8 default nextval(<mind_simpleQuoting><schemaname>.<tablename>_seq</mind_simpleQuoting>)";
|
||||
$this->attType['varchar'] = "varchar(<length>)";
|
||||
$this->attType['char'] = "char(<length>)";
|
||||
@@ -43,7 +43,25 @@
|
||||
}
|
||||
|
||||
/**
|
||||
* Remover todas as constraints realcionadas à tabela recebida, e entao rmover a tabela
|
||||
* Gets how to select the schema
|
||||
* @name selectSchema
|
||||
* @return String
|
||||
*/
|
||||
public function selectSchema($schemaName){
|
||||
return "SET searchpath to ".$schemaName;
|
||||
}
|
||||
|
||||
/**
|
||||
* Selects the schema
|
||||
* @name selectCurrentSchema
|
||||
* @return resource
|
||||
*/
|
||||
public function selectCurrentSchema($dbConn, $schemaName){
|
||||
return pg_query($dbConn, "SET searchpath to ".$schemaName);
|
||||
}
|
||||
|
||||
/**
|
||||
* Remover todas as constraints realcionadas à tabela recebida, e entao rmover a tabela
|
||||
* @return String
|
||||
*/
|
||||
public function removeTable($dbConn, $tableName){
|
||||
@@ -71,7 +89,7 @@
|
||||
/**
|
||||
* Recupera o ultimo erro
|
||||
*
|
||||
* @param Object $dbConn Conexão
|
||||
* @param Object $dbConn Conex�o
|
||||
* @return String Erro
|
||||
*/
|
||||
function getLastError($dbConn)
|
||||
@@ -82,7 +100,7 @@
|
||||
/**
|
||||
* Conecta a base de dados
|
||||
*
|
||||
* @param Object $ob Objeto com os dados para conexão
|
||||
* @param Object $ob Objeto com os dados para conex�o
|
||||
* @return Object Resource
|
||||
*/
|
||||
function connectTo($ob)
|
||||
@@ -99,7 +117,7 @@
|
||||
/**
|
||||
* Desconecta
|
||||
*
|
||||
* @param Object $dbCon Conexão
|
||||
* @param Object $dbCon Conex�o
|
||||
* @return Object Resource
|
||||
*/
|
||||
function disconnectFrom($dbCon)
|
||||
@@ -110,7 +128,7 @@
|
||||
/**
|
||||
* Verifica se uma tabela existe
|
||||
*
|
||||
* @param Object $dbCon Conexão
|
||||
* @param Object $dbCon Conex�o
|
||||
* @param String $table Nome da tabela
|
||||
* @return Boolean
|
||||
*/
|
||||
@@ -122,7 +140,7 @@
|
||||
}
|
||||
|
||||
/**
|
||||
* Escreve o cabeçalho do arquivo SQL
|
||||
* Escreve o cabe�alho do arquivo SQL
|
||||
* @return String Header
|
||||
*/
|
||||
public function getHeader()
|
||||
@@ -136,8 +154,8 @@
|
||||
}
|
||||
|
||||
/**
|
||||
* Escreve a função para conexão com o Postgres
|
||||
* @return String Função connectToPostgres()
|
||||
* Escreve a fun��o para conex�o com o Postgres
|
||||
* @return String Fun��o connectToPostgres()
|
||||
*/
|
||||
public function establishConnection()
|
||||
{
|
||||
@@ -154,7 +172,7 @@
|
||||
/**
|
||||
* Executa uma Query
|
||||
*
|
||||
* @param Object $dbCon Conexão
|
||||
* @param Object $dbCon Conex�o
|
||||
* @param String $qr Query
|
||||
* @return Object Resource
|
||||
*/
|
||||
@@ -164,7 +182,7 @@
|
||||
}
|
||||
|
||||
/**
|
||||
* Fecha uma conexão
|
||||
* Fecha uma conex�o
|
||||
* @return String Close
|
||||
*/
|
||||
public function closeConnection()
|
||||
@@ -218,7 +236,7 @@
|
||||
}
|
||||
|
||||
/**
|
||||
* Define um valor padrão
|
||||
* Define um valor padr�o
|
||||
* @return String default
|
||||
*/
|
||||
public function setDefaultValue()
|
||||
@@ -273,8 +291,8 @@
|
||||
}
|
||||
|
||||
/**
|
||||
* Primary Key padrão
|
||||
* @return String para Primary Key padrão
|
||||
* Primary Key padr�o
|
||||
* @return String para Primary Key padr�o
|
||||
*/
|
||||
public function defaultPrimaryKey()
|
||||
{
|
||||
|
||||
@@ -7,6 +7,9 @@
|
||||
public function getLastError($dbCon); // returns the last occurred error
|
||||
public function tableExists($conObj, $table); // returns false if the table doesn't exist
|
||||
|
||||
public function selectSchema($schemaName); // return the string to select the schema if supported or "" if not
|
||||
public function selectCurrentSchema($dbConn,
|
||||
$schemaName); // selects the current schema, if supported, or true if not
|
||||
public function getHeader(); // returns the header, like comments on top, possible variables or calls to select dataBase
|
||||
public function establishConnection(); // returns the STRING needed to the connection
|
||||
public function closeConnection(); // returns the STRING needed to the disconnection
|
||||
@@ -21,8 +24,8 @@
|
||||
public function createPK(); // returns the STRING of the command used to specify the primary key
|
||||
public function createTable(); // returns the STRING of the command used to create a table
|
||||
public function createField(); // returns the STRING of the command used to create a field into the createTable command
|
||||
public function setDefaultValue(); // ???
|
||||
public function defaultPrimaryKey(); // ???
|
||||
public function removeTable($dbConn, $tableName); // ???
|
||||
public function setDefaultValue();
|
||||
public function defaultPrimaryKey();
|
||||
public function removeTable($dbConn, $tableName);
|
||||
}
|
||||
?>
|
||||
@@ -94,7 +94,7 @@
|
||||
|
||||
if(file_exists($bg.$cF) && $xml= @simplexml_load_file($bg.$cF))
|
||||
{
|
||||
if($xml->pwd['value']== $p && $xml->login['value']== $l || ((isset($_SESSION["user"]))? $_SESSION["user"]["login"]=="admin" : false))
|
||||
if(($xml->pwd['value']== $p && $xml->login['value']== $l) || ((isset($_SESSION["user"]))? $_SESSION["user"]["login"]=="admin" : false))
|
||||
{
|
||||
$xmlInfo= @simplexml_load_file($bg.$_MIND['userDir'].'/'.$l.'/info.xml');
|
||||
$this->login((string)$xml->login['value']);
|
||||
@@ -128,7 +128,10 @@
|
||||
$_MIND['fw']->outputPane('Error when trying to load the user information', true);
|
||||
}
|
||||
if(!$allowed)
|
||||
{
|
||||
$_MIND['fw']->outputPane('Invalid current password', true);
|
||||
return false;
|
||||
}
|
||||
return ($flag)? $this: false;
|
||||
}
|
||||
static function userExists($u)
|
||||
@@ -136,7 +139,7 @@
|
||||
GLOBAL $_MIND;
|
||||
return file_exists($_MIND['rootDir'].$_MIND['userDir'].'/'.$u);
|
||||
}
|
||||
static function getUsers()
|
||||
static function getUsers($login= false)
|
||||
{
|
||||
GLOBAL $_MIND;
|
||||
|
||||
@@ -149,19 +152,25 @@
|
||||
{
|
||||
if(substr($entry, 0,1) !='.')
|
||||
{
|
||||
$users[$c]= new User();
|
||||
$xmlInfo= @simplexml_load_file($dir.'/'.$entry.'/info.xml');
|
||||
$xml= @simplexml_load_file($dir.'/'.$entry.'/'.$_MIND['userConfFile'].'.xml');
|
||||
$users[$c]->login((string)$xml->login['value']);
|
||||
$users[$c]->code($users[$c]->login());
|
||||
$users[$c]->pwd((string)$xml->pwd['value']);
|
||||
$users[$c]->name(utf8_decode((string)$xmlInfo->name['value']));
|
||||
$users[$c]->status((string)$xml->status['value']);
|
||||
$users[$c]->email(utf8_decode((string)$xml->email['value']));
|
||||
$users[$c]->age((string)$xmlInfo->age['value']);
|
||||
$users[$c]->description(utf8_decode((string)$xmlInfo->description['value']));
|
||||
$users[$c]->position(utf8_decode((string)$xmlInfo->position['value']));
|
||||
$c++;
|
||||
if(!$login || (is_array($login)? in_array($entry, $login): $login == $entry))
|
||||
{
|
||||
$users[$c]= new User();
|
||||
$xmlInfo= @simplexml_load_file($dir.'/'.$entry.'/info.xml');
|
||||
$xml= @simplexml_load_file($dir.'/'.$entry.'/'.$_MIND['userConfFile'].'.xml');
|
||||
$users[$c]->login((string)$xml->login['value']);
|
||||
$users[$c]->code($users[$c]->login());
|
||||
if($login)
|
||||
$users[$c]->pwd('');
|
||||
else
|
||||
$users[$c]->pwd((string)$xml->pwd['value']);
|
||||
$users[$c]->name(utf8_decode((string)$xmlInfo->name['value']));
|
||||
$users[$c]->status((string)$xml->status['value']);
|
||||
$users[$c]->email(utf8_decode((string)$xml->email['value']));
|
||||
$users[$c]->age((string)$xmlInfo->age['value']);
|
||||
$users[$c]->description(utf8_decode((string)$xmlInfo->description['value']));
|
||||
$users[$c]->position(utf8_decode((string)$xmlInfo->position['value']));
|
||||
$c++;
|
||||
}
|
||||
}
|
||||
}
|
||||
$d->close();
|
||||
|
||||
@@ -11,8 +11,6 @@
|
||||
$p->version[2]= 0;
|
||||
$p->date= date('m/d/Y - H:i:s');
|
||||
|
||||
//echo $curVersion['date'].'<hr>';
|
||||
|
||||
if($p->version[1] <= $curVersion['subVersion'])
|
||||
{
|
||||
header("Location:update.php");
|
||||
@@ -38,6 +36,21 @@
|
||||
|
||||
$_MIND['fw']->updateCopy($dirFrom, $dirTo);
|
||||
|
||||
$usrs= User::getUsers($p->users); // loads only the users who are working on the current project
|
||||
echo sizeof($usrs).' <<< ';
|
||||
for($i=0, $j= sizeof($usrs); $i<$j; $i++)
|
||||
{
|
||||
//echo $usrs[$i]->email;
|
||||
if(mail($usrs[$i]->email, '[mind2.0] Project commited', "The project ".$p->name." was commited by ".$usrs[$i]->name.".
|
||||
|
||||
--
|
||||
TheWebMind.org 2.0
|
||||
http://thewebmind.org/
|
||||
Documentation: http://docs.thewebmind.org/"));
|
||||
else
|
||||
$_MIND['fw']->log('SMTP Server not found! Mail message culd not be sent.', 'server conf');
|
||||
}
|
||||
|
||||
echo 'The project has been successfully commited to the server';
|
||||
exit;
|
||||
}
|
||||
|
||||
@@ -2,31 +2,22 @@
|
||||
include('../../config/mind.php');
|
||||
include('../../'.$_MIND['framework']);
|
||||
include('../../'.$_MIND['header']);
|
||||
/*
|
||||
$ar= Array();
|
||||
$_POST['action']= explode(',', str_replace(' ', '', $_POST['action']));
|
||||
if(in_array('list', $_POST['action']))
|
||||
{
|
||||
$ar['list']= User::getUsers();
|
||||
}
|
||||
if(in_array('get', $_POST['action']))
|
||||
{
|
||||
$u= new User($_MIND['fw']->filter($_POST['code']));
|
||||
$ar['get']= Array();
|
||||
$ar['get']['info']= Array();
|
||||
$ar['get']['conf']= Array();
|
||||
$ar['get']['info']['name']= $u->name();
|
||||
$ar['get']['info']['age']= $u->age();
|
||||
$ar['get']['info']['description']= $u->description();
|
||||
$ar['get']['info']['position']= $u->position();
|
||||
$ar['get']['conf']['login']= $u->login();
|
||||
$ar['get']['conf']['status']= $u->status();
|
||||
$ar['get']['conf']['email']= $u->email();
|
||||
}
|
||||
echo json_encode($ar);
|
||||
*/
|
||||
$u= User::getUsers();
|
||||
|
||||
if($_POST && $_GET['login'])
|
||||
{
|
||||
$u= new User($_GET['login'], $_POST['pwd']);
|
||||
if(trim($_POST['pwd']) == '' || !$u)
|
||||
{
|
||||
echo "Error: Invalid password to the current user";
|
||||
exit;
|
||||
}
|
||||
echo 'aaaaa '.$_POST['pwd'].' - '.$u->name;
|
||||
$u->populate($_POST);
|
||||
$u->save();
|
||||
exit;
|
||||
}
|
||||
|
||||
$u= User::getUsers();
|
||||
?>
|
||||
<table style="width:100%;height:100%;">
|
||||
<tr>
|
||||
|
||||
@@ -105,7 +105,7 @@
|
||||
|
||||
|
||||
/**
|
||||
* small alias for simplexml_load_file
|
||||
* smaller alias for simplexml_load_file
|
||||
* @author Felipe Nascimento
|
||||
* @name loadXML
|
||||
* @param String $fileURL
|
||||
@@ -230,6 +230,32 @@
|
||||
include($_MIND['rootDir'].'/'.$_MIND['errorMessagesFile']);
|
||||
return new Error($erCod);
|
||||
}
|
||||
|
||||
/**
|
||||
* logs the message to the correct log file
|
||||
* use the following types:
|
||||
* "server conf" due to any requirement the server has not satisfied
|
||||
* "error", "warning" or "general" when it was not defined or specified
|
||||
* "encoding" when related to localization, idiom, charset or timezone
|
||||
* @author Felipe Nascimento
|
||||
* @name log
|
||||
* @param Strig $message
|
||||
* @param Strig $type server conf/error/warning/general/enconding
|
||||
* @return boolean
|
||||
*/
|
||||
function log($message, $type)
|
||||
{
|
||||
GLOBAL $_MIND;
|
||||
if(!preg_match('/log|server conf|error|warning|general|encoding/', $type))
|
||||
{
|
||||
$this->log('Impossible to log message! Invalid error type.', 'log');
|
||||
return false;
|
||||
}
|
||||
$f= fopen($_MIND['rootDir'].'/'.$_MIND['logDirectory'].'/'.$type.'.log', 'a');
|
||||
fwrite($f, $_SESSION['user']['login'].' -- '.date('M/d/Y H:i:s').': '.$message."\n");
|
||||
fclose($f);
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method also transmits the error to the client side, but calling a specific method from the js MindFramework
|
||||
|
||||
@@ -800,7 +800,8 @@ Mind.Project= {
|
||||
success: function(ret){
|
||||
Mind.Dialog.CloseMessage();
|
||||
Mind.Dialog.ShowMessage('Done');
|
||||
Mind.Dialog.CloseModal();
|
||||
setTimeout(Mind.Dialog.CloseMessage, 4000);
|
||||
Mind.Project.Update();
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
@@ -111,13 +111,13 @@ Mind.Progress = {
|
||||
setTimeout(function(){
|
||||
$("#mind_progressbar").progressbar( 'destroy' );
|
||||
$("#welcome_mind").html("Welcome!");
|
||||
},1000)
|
||||
},1000);
|
||||
setTimeout(function(){
|
||||
Mind.Commom.BlockerFadeOut();
|
||||
},1000);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Mind.Commom = {
|
||||
BlockerFadeOut : function(){
|
||||
@@ -128,13 +128,13 @@ Mind.Commom = {
|
||||
});
|
||||
}, 800);
|
||||
}
|
||||
}
|
||||
};
|
||||
Mind.Properties = {
|
||||
path : "",
|
||||
scriptsPath : "",
|
||||
pluginPath : "",
|
||||
showDeveloperMenu : ""
|
||||
}
|
||||
};
|
||||
|
||||
/*!
|
||||
* Mind.Dialog
|
||||
@@ -277,7 +277,7 @@ Mind.Dialog = {
|
||||
Cancel: function() {
|
||||
$(this).dialog('close');
|
||||
}
|
||||
}
|
||||
};
|
||||
break;
|
||||
case "manage" :
|
||||
$("#mind_dialog_content").html("");
|
||||
@@ -322,7 +322,7 @@ Mind.Dialog = {
|
||||
$("#list_panel").children().removeClass("manageListContentSelected");
|
||||
$(this).addClass("manageListContentSelected");
|
||||
document.getElementById("content_" + this.getAttribute("code")).style.display = "block";
|
||||
}
|
||||
};
|
||||
$("#list_panel").append(tempDiv);
|
||||
$("#content_panel").append(tempContentDiv);
|
||||
}
|
||||
@@ -340,7 +340,7 @@ Mind.Dialog = {
|
||||
Cancel: function() {
|
||||
$(this).dialog('close');
|
||||
}
|
||||
}
|
||||
};
|
||||
}else{
|
||||
bt = null;
|
||||
}
|
||||
@@ -469,13 +469,13 @@ Mind.Dialog = {
|
||||
onClose = onClose ? onClose : null;
|
||||
$.growlUI(title,message,timeout,onClose);
|
||||
if(timeout) // aqui
|
||||
setTimeout(function(){Mind.Dialog.CloseMessage()}, timeout);
|
||||
setTimeout(function(){Mind.Dialog.CloseMessage();}, timeout);
|
||||
},
|
||||
|
||||
CloseMessage : function(){
|
||||
$.unblockUI();
|
||||
}
|
||||
}
|
||||
};
|
||||
//setTimeout(function(){Mind.Dialog.ShowMessage('TESTE', false, false, false);}, 6000);
|
||||
/* PANELS */
|
||||
Mind.Panel = new Array();
|
||||
@@ -745,7 +745,7 @@ Mind.Panels = {
|
||||
)
|
||||
);*/
|
||||
$("#"+Mind.Panel['bottom'].htmlElement.id+" [autoresize]").each(function(){
|
||||
this.style.height= Mind.Panel['bottom'].htmlElement.offsetHeight-42
|
||||
this.style.height= Mind.Panel['bottom'].htmlElement.offsetHeight-42;
|
||||
if(this.getAttribute('autoresize') != 'true')
|
||||
this.style.height= parseInt(this.style.height) - parseInt(this.getAttribute('autoresize'));
|
||||
});
|
||||
@@ -845,7 +845,7 @@ Mind.Panels = {
|
||||
//Mind.Panel['right'].htmlElement.getElementsByTagName('DIV')[0].style.width = x;
|
||||
Mind.Panel['right'].Content.style.width = x-5;
|
||||
Mind.Panel['right'].Content.style.left = document.body.clientWidth-x+5;
|
||||
$("#vertical_resizable_bar_right").css("left",event.clientX);
|
||||
$("#vertical_resizable_bar_right").css("left",event.clientX);
|
||||
$('#blocker').css("display","block");
|
||||
$('#blocker').css("cursor","w-resize");
|
||||
Mind.Panel["center"].Adjust();
|
||||
@@ -922,7 +922,7 @@ Mind.Panels = {
|
||||
},
|
||||
|
||||
HideLefPanel : function(){
|
||||
alert("Hide the left Panel")
|
||||
alert("Hide the left Panel");
|
||||
},
|
||||
Open : function(panel){
|
||||
if(panel)
|
||||
@@ -960,7 +960,7 @@ Mind.Panels = {
|
||||
Mind.Panel['bottom'].Adjust();
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Mind.ProjectPane= {
|
||||
Update:function (objList){
|
||||
@@ -975,7 +975,7 @@ Mind.ProjectPane= {
|
||||
}
|
||||
document.getElementById('projectsPane').innerHTML= str;
|
||||
}
|
||||
}
|
||||
};
|
||||
Mind.Temp= Array();
|
||||
Mind.Components= Array();
|
||||
Mind.Component= {
|
||||
@@ -1027,10 +1027,10 @@ Mind.Component= {
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
Mind.Window.onresize = function(event){
|
||||
Mind.Panels.Reset();
|
||||
}
|
||||
};
|
||||
|
||||
Mind.AjaxHandler = {
|
||||
AjaxErrors : new Array(),
|
||||
@@ -1073,7 +1073,7 @@ Mind.AjaxHandler = {
|
||||
}
|
||||
Mind.Plugins.OnReporting();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Mind.jsError= {
|
||||
Init: function(){
|
||||
@@ -1154,7 +1154,7 @@ Mind.Utils = {
|
||||
|
||||
self.focus();
|
||||
//window.onbeforeunload = function () { Mind.Theme.Save(); return 'Are you sure you want to exit?' }
|
||||
window.onbeforeunload = function () { Mind.Theme.Save(); }
|
||||
window.onbeforeunload = function () { Mind.Theme.Save(); };
|
||||
|
||||
window.onselectstart = function(){
|
||||
return (event.srcElement.tagName=='INPUT' || event.srcElement.tagName=='TEXTAREA' || event.srcElement.tagName=='SELECT')? true: false;
|
||||
@@ -1175,10 +1175,10 @@ Mind.Utils = {
|
||||
"topmargin" : "0",
|
||||
"bottommargin" : "0",
|
||||
"rightmargin" : "0"
|
||||
}
|
||||
};
|
||||
$("body").attr(bodyAttributes);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Mind.Theme = {
|
||||
userConfig: {
|
||||
@@ -1208,7 +1208,7 @@ Mind.Theme = {
|
||||
bottomPanelPos : '',
|
||||
editorFull : false,
|
||||
tabsFull : false
|
||||
}
|
||||
};
|
||||
|
||||
document.getElementById('mindEditor').style.fontWeight= 'normal';
|
||||
document.getElementById('mindEditor').style.fontStyle= 'normal';
|
||||
@@ -1267,7 +1267,7 @@ Mind.Theme = {
|
||||
apagaCookie('Mind.Theme.theme');
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
Mind.Menus = {
|
||||
Init : function(){
|
||||
Mind.Menus.Manage.Init();
|
||||
@@ -1291,9 +1291,9 @@ Mind.Menus.Manage = {
|
||||
Mind.Dialog.OpenModal(true,'770','523','Manage Users','midle','manage_user.php','form',function(){},false,true);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Mind.View = {};
|
||||
|
||||
@@ -1311,6 +1311,24 @@ Mind.View.User = {
|
||||
true);
|
||||
},
|
||||
Manage : function(){
|
||||
(function(){
|
||||
Save = function(name){
|
||||
Mind.Utils.SetLoad(true);
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "framework/components/manage_user.php?action=saveuser&login="+name,
|
||||
data: $("#manage_user_form").serialize(),
|
||||
success: function(msg){
|
||||
if(msg.substring(0,5) == 'Error')
|
||||
Mind.Dialog.ShowAlert(msg, "Error!");
|
||||
Mind.Utils.SetLoad(false);
|
||||
},
|
||||
error : function(XMLHttpRequest, textStatus, errorThrown){
|
||||
Mind.AjaxHandler.Capture(XMLHttpRequest);
|
||||
}
|
||||
});
|
||||
};
|
||||
})();
|
||||
$(".list_users").bind("click",
|
||||
function(){
|
||||
$(".user_content_list").css("visibility","hidden");
|
||||
@@ -1325,7 +1343,14 @@ Mind.View.User = {
|
||||
'userList',
|
||||
'',
|
||||
function(comps){
|
||||
comps= Mind.Component.Parse(comps);
|
||||
try
|
||||
{
|
||||
comps= Mind.Component.Parse(comps);
|
||||
}catch(e){
|
||||
Mind.Dialog.ShowAlert("Failed loading the list of users. Probably you are not allowed to do this", "Error");
|
||||
Mind.Dialog.CloseModal();
|
||||
return false;
|
||||
}
|
||||
var user = comps.userData;
|
||||
var content = "<form id='manage_user_form'>";
|
||||
content += "<span class='plugin_name'>" + user.login + "</span><br>";
|
||||
@@ -1335,17 +1360,17 @@ Mind.View.User = {
|
||||
content += "<tr><td><b><i>Description:</i></b><br><textarea name='description'>"+ user.description +"</textarea></td><tr>";
|
||||
content += "<tr><td><b><i>Position:</i></b><br> <input name='position' value='" + user.position + "' type='text'></td><tr>";
|
||||
content += "<tr><td><b><i>E-mail:</i></b><br> <input name='email' value='"+ user.email +"' type='text'></td><tr>";
|
||||
content += "<tr><td><b><i>Password:</i></b><br><input name='pwd' value='" + user.password +" 'type='text'></td><tr>";
|
||||
content += "<tr><td><b><i>Password:</i></b><br><input name='pwd' value='" + (user.password||'') +"' type='password'></td><tr>";
|
||||
content += "<tr><td><button onclick='Save(\""+user.login+"\")' onmouseover='$(this).addClass(\"ui-state-hover\")' onmouseout='$(this).removeClass(\"ui-state-hover\")' class='ui-state-default ui-corner-all' type='button'>Save</button></td>";
|
||||
content += "<td colspan='2'><br><button onclick='Remove(\""+user.login+"\")' onmouseover='$(this).addClass(\"ui-state-hover\")' onmouseout='$(this).removeClass(\"ui-state-hover\")' class='ui-state-default ui-corner-all' type='button'>Remove</button></td></tr></table>";
|
||||
content += "</form>"
|
||||
content += "<td colspan='2'><button onclick='Remove(\""+user.login+"\")' onmouseover='$(this).addClass(\"ui-state-hover\")' onmouseout='$(this).removeClass(\"ui-state-hover\")' class='ui-state-default ui-corner-all' type='button'>Remove</button></td></tr></table>";
|
||||
content += "</form>";
|
||||
$(".user_content_list").html(content);
|
||||
});
|
||||
$(".user_content_list").css("visibility","visible");
|
||||
});
|
||||
$(".list_users").eq(0).trigger("click");
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Mind.View.Plugin = {
|
||||
Manage : function(){
|
||||
@@ -1370,14 +1395,14 @@ Mind.View.Plugin = {
|
||||
Mind.AjaxHandler.Capture(XMLHttpRequest);
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
})();
|
||||
|
||||
// Enable
|
||||
(function(){
|
||||
Enable = function(name){
|
||||
Disable("."+name,"enable");
|
||||
}
|
||||
};
|
||||
})();
|
||||
|
||||
// Uninstall
|
||||
@@ -1401,7 +1426,7 @@ Mind.View.Plugin = {
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
})();
|
||||
|
||||
$(".list_plugins").bind("click",
|
||||
@@ -1424,21 +1449,21 @@ Mind.View.Plugin = {
|
||||
var plugin = comps.pluginData;
|
||||
var content = "";
|
||||
content += "<span class='plugin_name'>" + plugin.name + "</span><br>";
|
||||
content += "<table cellspacing='5'>";
|
||||
content += "<table cellspacing='5' style='width:100%;'>";
|
||||
content += "<tr><td><b><i>Date:</i></b><br> " + plugin.date + "</td><tr>";
|
||||
content += "<tr><td><b><i>Authors:</i></b><br>" + plugin.authors + "</td><tr>";
|
||||
content += "<tr><td><b><i>Link:</i></b><br>" + plugin.link +"</td><tr>";
|
||||
content += "<tr><td><b><i>Description:</i></b><br>" + plugin.description + "</td><tr>";
|
||||
func = plugin.disabled ? "Enable" : "Disable";
|
||||
content += "<tr><td><button onclick='"+func+"(\""+plugin.name+"\")' onmouseover='$(this).addClass(\"ui-state-hover\")' onmouseout='$(this).removeClass(\"ui-state-hover\")' class='ui-state-default ui-corner-all' type='button'>"+func+"</button></td>";
|
||||
content += "<td colspan='2'><br><button onclick='Uninstall(\""+plugin.name+"\")' onmouseover='$(this).addClass(\"ui-state-hover\")' onmouseout='$(this).removeClass(\"ui-state-hover\")' class='ui-state-default ui-corner-all' type='button'>Uninstall</button></td></tr></table>";
|
||||
content += "<td colspan='2'><button onclick='Uninstall(\""+plugin.name+"\")' onmouseover='$(this).addClass(\"ui-state-hover\")' onmouseout='$(this).removeClass(\"ui-state-hover\")' class='ui-state-default ui-corner-all' type='button'>Uninstall</button></td></tr></table>";
|
||||
$(".plugin_content_list").html(content);
|
||||
});
|
||||
$(".plugin_content_list").css("visibility","visible");
|
||||
});
|
||||
$(".list_plugins").eq(0).trigger("click");
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Mind.View.Project = {
|
||||
|
||||
@@ -1470,7 +1495,7 @@ Mind.View.Project = {
|
||||
Mind.AjaxHandler.Capture(XMLHttpRequest);
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
})();
|
||||
|
||||
//Remove
|
||||
@@ -1501,7 +1526,7 @@ Mind.View.Project = {
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
})();
|
||||
|
||||
$(".list_projects").bind("click",function(){
|
||||
@@ -1664,14 +1689,14 @@ Mind.View.Project = {
|
||||
});
|
||||
$(".list_projects").eq(0).trigger("click");
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Mind.ConfirmUpdate= function(){
|
||||
//Mind.tmpShownData= Mind.Dialog.ShowData("<center><br/><br/><img src='"+Mind.Properties.imagesPath+"/load.gif'><br/>Checking for updates</center>",'Mind Updates', false, false, true);
|
||||
var url= Mind.Properties.path+'/../../mind_update.php?confirmUpdate=true';
|
||||
document.getElementById('mindUpdateImageLoader').style.display= '';
|
||||
document.getElementById('tempIframeForUpdate').src= url;
|
||||
}
|
||||
};
|
||||
Mind.UpdateItSelf= function(){
|
||||
|
||||
Mind.tmpShownData= Mind.Dialog.ShowData("<center><br/><br/><img src='"+Mind.Properties.imagesPath+"/load.gif'><br/>Checking for updates</center>",
|
||||
@@ -1693,7 +1718,7 @@ Mind.UpdateItSelf= function(){
|
||||
}
|
||||
});
|
||||
}, 600);
|
||||
}
|
||||
};
|
||||
|
||||
Mind.ImagePreLoader= {
|
||||
sources: Array(),
|
||||
@@ -1740,10 +1765,10 @@ Mind.FeedBack= {
|
||||
Mind.Dialog.OpenModal(true, '600', '530', 'FeedBack', 'middle', 'feedback.php', 'form');
|
||||
//ajax,width,height,title,position,source,type,callBack,buttons,noresizable
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Mind.Help= {
|
||||
Open: function(page){
|
||||
Mind.Dialog.OpenModal(true, '700', '530', 'Help', 'middle', 'help.php?page='+(page||'false'), 'form');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -35,7 +35,7 @@ FORM
|
||||
}
|
||||
input[type=text]
|
||||
{
|
||||
height:26px;
|
||||
height:23px;
|
||||
background-color:#fff;
|
||||
}
|
||||
pre
|
||||
@@ -370,6 +370,20 @@ pre
|
||||
border:solid 1px;
|
||||
padding:0px;
|
||||
}
|
||||
.plugin_left_list{
|
||||
vertical-align:top;
|
||||
width:150px;
|
||||
font-size:14px;
|
||||
border:solid 1px;
|
||||
padding:0px;
|
||||
}
|
||||
.user_left_list{
|
||||
vertical-align:top;
|
||||
width:150px;
|
||||
font-size:14px;
|
||||
border:solid 1px;
|
||||
padding:0px;
|
||||
}
|
||||
.projet_content_list{
|
||||
vertical-align:top;
|
||||
padding:5px;
|
||||
@@ -378,6 +392,14 @@ pre
|
||||
height:453px;
|
||||
background:white;
|
||||
}
|
||||
.user_content_list{
|
||||
vertical-align:top;
|
||||
padding:5px;
|
||||
width:570px;
|
||||
overflow:hidden;
|
||||
height:453px;
|
||||
background:white;
|
||||
}
|
||||
.plugin_content_list{
|
||||
vertical-align:top;
|
||||
padding:5px;
|
||||
@@ -396,6 +418,11 @@ pre
|
||||
background-image:url(../../images/load.gif);
|
||||
background-repeat:no-repeat;
|
||||
}
|
||||
.user_parent{
|
||||
border:solid 1px;vertical-align:top;
|
||||
background-image:url(../../images/load.gif);
|
||||
background-repeat:no-repeat;
|
||||
}
|
||||
.plugin_parent{
|
||||
border:solid 1px;vertical-align:top;
|
||||
background-image:url(../../images/load.gif);
|
||||
|
||||
@@ -1 +1 @@
|
||||
{"alunos":"aluno","alunas":"aluno","aluna":"aluno","professores":"professor","professora":"professor","professoras":"professor","comentarios":"comentario"}
|
||||
{"alunos":"aluno","alunas":"aluno","aluna":"aluno","professores":"professor","professora":"professor","professoras":"professor","comentarios":"comentario","funcoes":"funcao"}
|
||||
Referência em uma Nova Issue
Bloquear um usuário