Plugin Directory

Changeset 768335


Ignore:
Timestamp:
09/07/2013 05:54:01 PM (12 years ago)
Author:
RiverNight
Message:
  • MàJ OBLIGATOIRE
  • MàJ de la gestion des informations permettant la connexion au serveur
Location:
rivercraft/trunk
Files:
2 added
6 edited

Legend:

Unmodified
Added
Removed
  • rivercraft/trunk/JSONAPI.php

    r653693 r768335  
    1515    public $host;
    1616    public $port;
    17     public $salt;
    1817    public $username;
    1918    public $password;
     
    2625     * Creates a new JSONAPI instance.
    2726     */
    28     public function __construct ($host, $port, $uname, $pword, $salt) {
     27    public function __construct ($host, $port, $uname, $pword) {
    2928        $this->host = $host;
    3029        $this->port = $port;
    3130        $this->username = $uname;
    3231        $this->password = $pword;
    33         $this->salt = $salt;
    3432       
    3533        if(!extension_loaded("cURL")) {
     
    4846            $method = json_encode($method);
    4947        }
    50         return hash('sha256', $this->username . $method . $this->password . $this->salt);
     48        return hash('sha256', $this->username . $method . $this->password);
    5149    }
    5250   
  • rivercraft/trunk/css/style.css

    r659313 r768335  
    2727
    2828.rcstatus h4, .rconplayer h4{
     29    font-weight: bolder;
    2930    text-decoration: underline;
    3031    display: inline;
  • rivercraft/trunk/panel.php

    r653693 r768335  
    11<?php
     2
     3    /**
     4        *@package Rivercraft
     5        *@version 1.3
     6    */
     7
     8      ////////////////////////////////////////////////////////////////
     9     // Add rivercraft panel for settings                          //
     10    ////////////////////////////////////////////////////////////////
    211
    312    add_action('admin_menu', 'panel');
    413
    514    function panel(){
    6         add_menu_page( 'RiverCraft - Configuration', 'RiverCraft', 'activate_plugins', 'rivercraft-panel', 'render_panel', null, 63);
     15        add_menu_page( 'RiverCraft - Configuration', 'RiverCraft', 'activate_plugins', 'rivercraft-panel', 'rc_panel', plugins_url('Rivercraft/css/img/back_office/settings.png'), '99.1' );
    716    }
    817
    9     function render_panel(){
     18    $salt = get_option('saltrc', '');
     19    if (isset($salt)) {
     20        delete_option('saltrc');
     21    }
     22
     23    function rc_panel(){
    1024        if (isset($_POST['panel_update'])) {
    1125            foreach ($_POST['options'] as $name => $value) {
     
    6478                                    </td>
    6579                                </tr>
    66                                 <tr>
    67                                     <th scope="row">
    68                                         <label for="saltrc">Salt</label>
    69                                     </th>
    70                                     <td>
    71                                         <input type="text" placeholder="Votre salt de JSONAPI" id="saltrc" name="options[saltrc]" value="<?php print(get_option( 'saltrc', '' )); ?>" size="100">
    72                                     </td>
    73                                 </tr>
    7480                            </tbody>                   
    7581                        </table>
  • rivercraft/trunk/readme.txt

    r661266 r768335  
    55Tags: jsonapi, minecraft, bukkit
    66Requires at least: 3.0
    7 Tested up to: 3.5
    8 Stable tag: 1.2.1
     7Tested up to: 3.6
     8Stable tag: 1.3
    99License: GPLv2 or later
    1010 
     
    1717 
    1818== Installation ==
    19  
    2019<ul>
    21     <li>
    22         Vous devez tout d'abord installer le plugin <a href="http://dev.bukkit.org/server-mods/jsonapi/">JSONAPI</a> dans le dossier Plugin du serveur CraftBukkit.
    23     </li>
    24     <li>   
    25         Ensuite réactulaiser ou redémarrer votre serveur.
    26         Un nouveau dossier au nom de JSONAPI devrai apparaître dans le dossier Plugin.
    27     </li>
    28     <li>
    29         Ouvrez le fichier config.yml qui s'y trouve.
    30         Vous devriez voir : <br>
    31             <ul>
    32                 <li style="list-style-type:none;">
    33                     <code>
    34                     method-whitelist: <br>
    35                         - getPlayerLimit <br>
    36                         - dynmap.getPort <br>
    37                     logins: <br>
    38                         usernameGoesHere: passwordGoesHere <br>
    39                     options: <br>
    40                         startup-delay: 2000 <br>
    41                         port: 20059 <br>
    42                         ip-whitelist: [] <br>
    43                         log-to-console: true <br>
    44                         log-to-file: 'false' <br>
    45                         salt: 'salt goes here' <br>
    46                         anyone-can-use-calladmin: true <br>
    47                         server-name: 'default' <br>
    48                     </code>
    49                 </li>
    50             </ul>
     20    <li>Vous devez tout d'abord installer le plugin <a href="http://dev.bukkit.org/server-mods/jsonapi/">JSONAPI</a> dans le dossier Plugin de votre serveur CraftBukkit.</li>
     21    <li>Ensuite réactulaiser ou redémarrer votre serveur. <br>
     22        Un nouveau dossier au nom de JSONAPI devrai apparaître dans le dossier Plugin.  </li>
     23    <li>Ouvrez le fichier config.yml qui s'y trouve. Vous devriez voir : </li>
     24            <pre>
     25                method-whitelist:   
     26                    - getPlayerLimit
     27                    - dynmap.getPort
     28                options:
     29                    stream_pusher:
     30                        max_queue_age: 30
     31                        max_queue_length: 500
     32                    startup-delay: 2000
     33                    port: 20059
     34                    ip-whitelist: []
     35                    log-to-console: true
     36                    log-to-file: 'false
     37                    anyone-can-use-calladmin: true
     38                    use-new-api: false
     39            </pre>
     40   
     41    <li>Modifiez "20059" avec le port demandé au préalable à votre hébergeur.</li>
    5142
    52             <br><ul>
    53                 <li>Modifiez "usernameGoeshere" avec un nom d'utilisateur.</li>
    54                 <li>Modifiez "passwordGoesHere" avec un mot de passe.</li>
    55                 <li>Modifiez "20059" avec le port demandé au préalable à votre hébergeur.</li>
    56                 <li>Modifiez "salt goes here" avec un second mot de passe.</li>
    57                 <li>Exemple de configuration: <br>
    58                     <code>
    59                         method-whitelist: <br>
    60                             - getPlayerLimit <br>
    61                             - dynmap.getPort <br>
    62                         logins: <br>
    63                             root: root <br>
    64                         options: <br>
    65                             startup-delay: 2000 <br>
    66                             port: 25600 <br>
    67                             ip-whitelist: [] <br>
    68                             log-to-console: true <br>
    69                             log-to-file: 'false' <br>
    70                             salt: salt <br>
    71                             anyone-can-use-calladmin: true <br>
    72                             server-name: 'default' <br>
    73                     </code>
    74                 </li>
    75             </ul>
     43    <li>Ouvrez le fichier user.yml qui s'y trouve.Vous devriez voir :</li>     
     44        <pre>
     45            users:
     46                users1:
     47                    username: usernameGoeshere
     48                    password: passwordGoesHere
     49                    groups:
     50                    - full_control
     51        </pre>
    7652
    77            
    78     </li>
     53    <li>Modifiez "usernameGoeshere" avec un nom d'utilisateur.</li>
     54    <li>Modifiez "passwordGoesHere" avec un mot de passe.</li>
    7955
    80     <li>
    81         Installez RiverCraft, si ce n'est pas déjà fait sur votre site/blog Wordpress.
    82     </li>
     56    <li>Installez RiverCraft, si ce n'est pas déjà fait sur votre site/blog Wordpress.  </li>
    8357    <li>Allez dans le nouveau menu Rivecraft qui se trouve dans votre BackOffice.</li>
    8458    <li>Insérez les  informations demandés</li>
    85     <li>Allez dans le Apparence>Widgets et activez le widget. Normalement les champs sont déjà remplis. Vous pouvez éventuellement modifier ces champs pour afficher un autre serveur.</li>
    86 
    87 </ul>
    88 
     59    <li>Allez dans le Apparence>Widgets et activez le widget. Les champs sont déjà remplis. Vous pouvez éventuellement modifier ces champs pour afficher un autre serveur.</li>
     60</ul>
     61   
    8962== Screenshots ==
    90 
    91 1. Exemple d'un serveur en ligne
    92 2. Exemple d'un serveur hors ligne
    93 
     63/
    9464== Frequently Asked Questions ==
    95 
    96 <center>/</center>
    97 
     65/
    9866== Upgrade Notice ==
    99 
    100 <center>/</center>
    101 
     67/
    10268== Changelog ==
    10369
    104 = Version 1.2.1 (30/01/2013) =
     70= Version 1.3 (07/09/2013) =
    10571
    106 - Correctif
     72- MàJ OBLIGATOIRE
     73- MàJ de la gestion des informations permettant la connexion au serveur
    10774
    10875= Version 1.2 (25/01/2013) =
  • rivercraft/trunk/rivercraft.php

    r661266 r768335  
    33    /**
    44        *@package Rivercraft
    5         *@version 1.2.1
     5        *@version 1.3
    66     */
    77    /*
    8         Plugin Name: Rivercraft
     8        Plugin Name: Rivercraft_
    99        Description: Rivercraft permet d'unir Wordpress et Minecraft avec JSONAPI.
    10         Version: 1.2.1
     10        Version: 1.3
    1111        Author: Heithem DRIDI ( RiverNight )
    1212        License: GPLv2 or later
    1313    */
    1414
    15     require "JSONAPI.php";
    16     require "panel.php";
    17     require "widget.php";
    1815
    19     wp_enqueue_style('Rivercraft', '/wp-content/plugins/Rivercraft/css/style.css'); 
     16          ////////////////////////////////////////////////////////////////
     17         // Include page/file                                          //
     18        ////////////////////////////////////////////////////////////////
     19
     20
     21
     22
     23    //Require file
     24        require "JSONAPI.php";       // JSONAPI Class
     25        require "panel.php";        // Add a panel in Back-Office
     26        require "widget.php";      // Server statut widget
     27
     28
     29    //Include CSS files in the header
     30        wp_enqueue_style('Rivercraft', '/wp-content/plugins/RC/css/style.css');
     31
    2032
    2133?>
  • rivercraft/trunk/widget.php

    r661266 r768335  
    11<?php
    22
     3    /**
     4        *@package Rivercraft
     5        *@version 1.3
     6    */
     7
     8      ////////////////////////////////////////////////////////////////
     9     // Widget function                                            //
     10    ////////////////////////////////////////////////////////////////
     11
     12
    313    function rcou_widget(){
    4 
    5         register_widget("rcou_widget");
    6 
    7     }
     14        register_widget("rcou_widget");}
    815
    916    add_action("widgets_init", "rcou_widget");
    1017
    1118    class rcou_widget extends wp_widget{
    12 
    1319        function rcou_widget(){
    14 
    1520            $options = array(
    1621                "classname"   => "rcou-widget",
    17                 "description" => "Afficher sur votre site l'état de votre serveur Minecraft."
    18                 );
    19  
    20             $this->WP_widget("rcou-widget", "RiverCraft - Online User", $options);
    21 
    22         }
     22                "description" => "Afficher sur votre site l'état de votre serveur Minecraft.");
     23            $this->WP_widget("rcou-widget", "RiverCraft - Online User", $options);}
    2324     
    2425        function widget($arguments, $data){
    25 
    2626            $defaut = array(
    2727                "title"  => "",
     
    2929                "portrc" => "print(get_option( 'portrc', '' ));",
    3030                "userrc" => "print(get_option( 'userrc', '' ));",
    31                 "pwdrc"  => "print(get_option( 'pwdrc', '' ));",
    32                 "saltrc" => "print(get_option( 'saltrc', '' ));",
    33                 );
     31                "pwdrc"  => "print(get_option( 'pwdrc', '' ));",);
    3432
    3533            $ip          = $data['iprc'];
     
    3735            $user        = $data['userrc'];
    3836            $pwd         = $data['pwdrc'];
    39             $salt        = $data['saltrc'];
    4037            $api         = new JSONAPI($ip, $port, $user, $pwd, $salt);
    4138            $Server      = $api->call("getServer");
     
    4542            $Version     = $api->call("getBukkitVersion");
    4643
    47 
    4844            $data = wp_parse_args($data, $defaut);
    49              
     45           
    5046            global $wpdb;
    5147            $table_prefix = $wpdb->prefix;
     
    5450             
    5551            echo $before_widget;
    56             echo $before_title . $data['title']
    57                  
    58              . $after_title;
     52            echo $before_title . $data['title'] . $after_title;
     53
    5954            if ($Server["success"] == '') {
    6055                ?>
     
    6560                            </div>
    6661                    </div>
    67                 <?php
    68             }
    69             else {
     62                <?php
     63            }else {
    7064                ?>
    7165                    <div class="rcwidget">
     
    7771                        <div class="rconplayer">
    7872                            <h4>Joueur en ligne:</h4>
    79                             <p><?php print_r($PlayerCount["success"]) ?><strong> /<?php print_r($PlayerLimit["success"]) ?></strong></p>
     73                            <p><?php print_r($PlayerCount["success"]) ?><strong> /<?php print_r($PlayerLimit["success"]) ?></strong></div>
    8074                            <div><?php
    81                                     if ($PlayerNames["success"] == '') {
    82                                         echo "";
    83                                     }
    84                                     else {
    85                                         foreach ($PlayerNames["success"] as $key => $value) {
    86                                             echo"<img src=\"https://minotar.net/avatar/$value/32\" alt=\"$value\" title=\"$value\"> ";
    87                                         }
     75                                    foreach ($PlayerNames["success"] as $key => $value) {
     76                                        echo"<img src=\"https://minotar.net/avatar/$value/32\" alt=\"$value\" title=\"$value\"> ";
    8877                                    }
    8978                                ?>
    9079                            </div>
    9180                        </div>
    92                     </div>             
    9381                <?php
    9482            }
    9583                echo $after_widget;
    96 
    9784        }
    9885     
     
    10491            $content_new['userrc'] = esc_attr($content_new['userrc']);
    10592            $content_new['pwdrc']  = esc_attr($content_new['pwdrc']);
    106             $content_new['saltrc'] = esc_attr($content_new['saltrc']);
    10793            return $content_new;
    10894
     
    117103                "userrc" => "print(get_option( 'userrc', '' ));",
    118104                "pwdrc"  => "print(get_option( 'pwdrc', '' ));",
    119                 "saltrc" => "print(get_option( 'saltrc', '' ));",
    120105                );
    121106           
     
    155140                <input value="<?php print(get_option( 'pwdrc', '' )); ?>" name="<?php echo $this->get_field_name('pwdrc'); ?>" id="<?php echo $this->get_field_id('pwdrc'); ?>" type="password" />
    156141            </p>
    157             <p>
    158                 <!-- JSONAPI's Salt -->
    159                 <label for="<?php echo $this->get_field_id('saltrc'); ?>">Votre salt</label><br />
    160                 <input value="<?php print(get_option( 'saltrc', '' )); ?>" name="<?php echo $this->get_field_name('saltrc'); ?>" id="<?php echo $this->get_field_id('saltrc'); ?>" type="text" />
    161             </p>
    162142            <?php
    163143 
Note: See TracChangeset for help on using the changeset viewer.