/**
  * Web site configuration;
  * @last edit: $arsalanshah
  * @Reason: Initial;
  * @return bool;
  */
 function configurations_site()
 {
     $params = array('siteurl' => $this->weburl, 'datadir' => $this->datadir);
     $this->path = str_replace('installation/', '', ossn_installation_paths()->root);
     $templateFile = $this->path . "configurations/ossn.config.site.example.php";
     $template = file_get_contents($templateFile);
     if (!$template) {
         throw new Exception(ossn_installation_print('all:files:required'));
     }
     foreach ($params as $k => $v) {
         $template = str_replace("<<" . $k . ">>", $v, $template);
     }
     $settingsFilename = $this->path . "configurations/ossn.config.site.php";
     $result = file_put_contents($settingsFilename, $template);
     if (!$result) {
         return false;
     }
     return true;
 }
Exemple #2
0
<?php

/**
 * Open Source Social Network
 *
 * @package   (Informatikon.com).ossn
 * @author    OSSN Core Team <*****@*****.**>
 * @copyright 2014 iNFORMATIKON TECHNOLOGIES
 * @license   General Public Licence http://www.opensource-socialnetwork.org/licence
 * @link      http://www.opensource-socialnetwork.org/licence
 */
file_put_contents(ossn_installation_paths()->root . 'INSTALLED', 1);
$installed = ossn_installation_paths()->ossn_url . 'administrator';
header("Location: {$installed}");
<?php

/**
 * Open Source Social Network
 *
 * @package   (Informatikon.com).ossn
 * @author    OSSN Core Team <*****@*****.**>
 * @copyright 2014 iNFORMATIKON TECHNOLOGIES
 * @license   General Public Licence http://www.opensource-socialnetwork.org/licence
 * @link      http://www.opensource-socialnetwork.org/licence
 */
echo '<div><div class="layout-installation">';
echo '<div class="ossn-installation-message ossn-installation-success">' . ossn_installation_print('ossn:installed:message') . '</div><br />';
echo '<a href="' . ossn_installation_paths()->url . '?action=finish" class="button-blue primary">' . ossn_installation_print('ossn:install:finish') . '</a>';
echo '</div>';
 * @package   (Informatikon.com).ossn
 * @author    OSSN Core Team <*****@*****.**>
 * @copyright 2014 iNFORMATIKON TECHNOLOGIES
 * @license   General Public Licence http://opensource-socialnetwork.com/licence
 * @link      http://www.opensource-socialnetwork.com/licence
 */
require_once dirname(dirname(dirname(__FILE__))) . '/system/start.php';
?>
<div class="layout-installation">
    <h2> <?php 
echo ossn_installation_print('create:admin:account');
?>
 </h2>

    <form action="<?php 
echo ossn_installation_paths()->url;
?>
?action=account" method="post">
        <div>
            <input type="text" name="firstname" placeholder="<?php 
echo ossn_print('first:name');
?>
"/>
            <input type="text" name="lastname" placeholder="<?php 
echo ossn_print('last:name');
?>
"/>
        </div>

        <div>
            <input type="text" name="email" placeholder="<?php 
    $error[] = 'apache';
}
if (OssnInstallation::is_mod_rewrite()) {
    echo '<div class="ossn-installation-message ossn-installation-success">' . ossn_installation_print('ossn:install:modrewrite') . '</div>';
} else {
    echo '<div class="ossn-installation-message ossn-installation-fail">' . ossn_installation_print('ossn:install:modrewrite:required') . '</div>';
    $error[] = 'mod_rewrite';
}
if (OssnInstallation::isCurl()) {
    echo '<div class="ossn-installation-message ossn-installation-success">' . ossn_installation_print('ossn:install:curl') . '</div>';
} else {
    echo '<div class="ossn-installation-message ossn-installation-fail">' . ossn_installation_print('ossn:install:curl:required') . '</div>';
    $error[] = 'php:curl';
}
if (OssnInstallation::isPhpGd()) {
    echo '<div class="ossn-installation-message ossn-installation-success">' . ossn_installation_print('ossn:install:gd') . '</div>';
} else {
    echo '<div class="ossn-installation-message ossn-installation-fail">' . ossn_installation_print('ossn:install:gd:required') . '</div>';
    $error[] = 'php:gd';
}
if (OssnInstallation::isCon_WRITEABLE()) {
    echo '<div class="ossn-installation-message ossn-installation-success">' . ossn_installation_print('ossn:install:config') . '</div>';
} else {
    echo '<div class="ossn-installation-message ossn-installation-fail">' . ossn_installation_print('ossn:install:config:error') . '</div>';
    $error[] = 'permission:configuration';
}
echo '<br />';
if (!isset($error)) {
    echo '<a href="' . ossn_installation_paths()->url . '?page=settings" class="button-blue primary">' . ossn_installation_print('ossn:install:next') . '</a>';
}
echo '</div><br /><br /></div>';
/**
 * Generate .htaccess file
 *
 * @return ooolean;
 */
function ossn_generate_server_config_setup($type)
{
    if ($type == 'apache') {
        $path = str_replace('installation/', '', ossn_installation_paths()->root);
        $file = ossn_installation_paths()->root . 'configs/htaccess.dist';
        $file = file_get_contents($file);
        return file_put_contents($path . '.htaccess', $file);
    } elseif ($type == 'nginx') {
        return false;
    }
    return false;
}
Exemple #7
0
/**
 * Open Source Social Network
 *
 * @package   (Informatikon.com).ossn
 * @author    OSSN Core Team <*****@*****.**>
 * @copyright 2014 iNFORMATIKON TECHNOLOGIES
 * @license   General Public Licence http://www.opensource-socialnetwork.org/licence
 * @link      http://www.opensource-socialnetwork.org/licence
 */
$Settings = new OssnInstallation();
$Settings->dbusername($_POST['dbuser']);
$Settings->dbpassword($_POST['dbpwd']);
$Settings->dbhost($_POST['dbhost']);
$Settings->dbname($_POST['dbname']);
$Settings->weburl($_POST['url']);
$Settings->datadir($_POST['datadir']);
$Settings->setStartupSettings(array('owner_email' => $_POST['owner_email'], 'notification_email' => $_POST['notification_email'], 'sitename' => $_POST['sitename']));
if (empty($_POST['owner_email']) || empty($_POST['notification_email']) || empty($_POST['sitename'])) {
    ossn_installation_message(ossn_installation_print('fields:require'), 'fail');
    $failed = ossn_installation_paths()->url . '?page=settings';
    header("Location: {$failed}");
    exit;
}
if ($Settings->INSTALL()) {
    $installed = ossn_installation_paths()->url . '?page=account';
    header("Location: {$installed}");
} else {
    ossn_installation_message($Settings->error_mesg, 'fail');
    $failed = ossn_installation_paths()->url . '?page=settings';
    header("Location: {$failed}");
}
/**
 * Handle insallation actions
 *
 * @return false|null data
 */
function ossn_installation_actions()
{
    if (isset($_REQUEST['action'])) {
        $page = $_REQUEST['action'];
    }
    if (!isset($page)) {
        return false;
    }
    switch ($page) {
        case 'install':
            include_once ossn_installation_paths()->root . 'actions/install.php';
            break;
        case 'account':
            include_once ossn_installation_paths()->root . 'actions/account.php';
            break;
        case 'finish':
            include_once ossn_installation_paths()->root . 'actions/finish.php';
            break;
    }
}