예제 #1
0
 /**
  *  Fonction qui dit si cet utilisateur est un redacteur existant dans spip
  *  @return     int     1=existe, 0=n'existe pas, -1=erreur
  */
 function is_in_spip()
 {
     if (defined("ADHERENT_USE_SPIP") && ADHERENT_USE_SPIP == 1 && defined('ADHERENT_SPIP_SERVEUR') && ADHERENT_SPIP_SERVEUR != '' && defined('ADHERENT_SPIP_USER') && ADHERENT_SPIP_USER != '' && defined('ADHERENT_SPIP_PASS') && ADHERENT_SPIP_PASS != '' && defined('ADHERENT_SPIP_DB') && ADHERENT_SPIP_DB != '') {
         $query = "SELECT login FROM spip_auteurs WHERE login='******'";
         $mydb = new DoliDb('mysql', ADHERENT_SPIP_SERVEUR, ADHERENT_SPIP_USER, ADHERENT_SPIP_PASS, ADHERENT_SPIP_DB, ADHERENT_SPIP_PORT);
         if ($mydb->ok) {
             $result = $mydb->query($query);
             if ($result) {
                 if ($mydb->num_rows($result)) {
                     # nous avons au moins une reponse
                     $mydb->close($result);
                     return 1;
                 } else {
                     # nous n'avons pas de reponse => n'existe pas
                     $mydb->close($result);
                     return 0;
                 }
             } else {
                 # error
                 $this->error = $mydb->error();
                 return -1;
             }
         } else {
             $this->error = "Echec de connexion avec les identifiants " . ADHERENT_SPIP_SERVEUR . " " . ADHERENT_SPIP_USER . " " . ADHERENT_SPIP_PASS . " " . ADHERENT_SPIP_DB;
             return -1;
         }
     }
 }
예제 #2
0
			}
		}

		# Boucle sur chaque fichier
		foreach($filelist as $file)
		{
			print '<tr><td nowrap>';
			print $langs->trans("ChoosedMigrateScript").'</td><td align="right">'.$file.'</td></tr>'."\n";

			$name = substr($file, 0, dol_strlen($file) - 4);

			// Run sql script
			$ok=run_sql($dir.$file, 0, '', 1);
		}
	}

	print '</table>';

	if ($db->connected) $db->close();
}


if (empty($actiondone))
{
    print '<div class="error">'.$langs->trans("ErrorWrongParameters").'</div>';
}

pFooter(! $ok && empty($_GET["ignoreerrors"]),$setuplang);

?>
예제 #3
0
					//if ($check1 != $dolibarr_main_db_character_set) dolibarr_install_syslog('etape1: Value for character_set is not the one asked for database creation', LOG_WARNING);
					//if ($check2 != $dolibarr_main_db_collation)     dolibarr_install_syslog('etape1: Value for collation is not the one asked for database creation', LOG_WARNING);
				}
				else
				{
					// Affiche aide diagnostique
					print '<tr><td colspan="2"><br>';
					print $langs->trans("ErrorFailedToCreateDatabase",$dolibarr_main_db_name).'<br>';
					print $langs->trans("IfDatabaseExistsGoBackAndCheckCreate");
					print '<br>';
					print '</td></tr>';

					dolibarr_install_syslog('etape1: Failed to create database '.$dolibarr_main_db_name.' '.$db->lasterrno().' '.$db->lasterror(), LOG_ERR);
					$error++;
				}
				$db->close();
			}
			else {
				print '<tr><td>';
				print $langs->trans("DatabaseCreation")." (".$langs->trans("User")." ".$userroot.") : ";
				print $dolibarr_main_db_name;
				print '</td>';
				print '<td>'.$langs->trans("Error").'</td>';
				print '</tr>';

				// Affiche aide diagnostique
				print '<tr><td colspan="2"><br>';
				print $langs->trans("YouAskDatabaseCreationSoDolibarrNeedToConnect",$dolibarr_main_db_user,$dolibarr_main_db_host,$userroot);
				print '<br>';
				print $langs->trans("BecauseConnectionFailedParametersMayBeWrong").'<br><br>';
				print $langs->trans("ErrorGoBackAndCorrectParameters").'<br><br>';