Proyectos de Subversion Moodle

Rev

Rev 1 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 1 Rev 1441
Línea 14... Línea 14...
14
// You should have received a copy of the GNU General Public License
14
// You should have received a copy of the GNU General Public License
15
// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
15
// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
Línea 16... Línea 16...
16
 
16
 
Línea 17... Línea -...
17
namespace tool_mobile;
-
 
18
 
17
namespace tool_mobile;
Línea 19... Línea 18...
19
use core\session\utility\cookie_helper;
18
 
20
use html_writer;
19
use html_writer;
21
 
20
 
Línea 74... Línea 73...
74
        $url = tool_mobile_create_app_download_url();
73
        $url = tool_mobile_create_app_download_url();
75
        if (empty($url)) {
74
        if (empty($url)) {
76
            return;
75
            return;
77
        }
76
        }
78
        $hook->add_html(
77
        $hook->add_html(
-
 
78
            html_writer::div(
79
            html_writer::link($url, get_string('getmoodleonyourmobile', 'tool_mobile'), ['class' => 'mobilelink']),
79
                html_writer::link($url, get_string('getmoodleonyourmobile', 'tool_mobile'), ['class' => 'mobilelink']),
-
 
80
            ),
80
        );
81
        );
81
    }
82
    }
Línea 82... Línea 83...
82
 
83
 
83
    /**
84
    /**
Línea 95... Línea 96...
95
            if (empty($SESSION->wantsurl) || strpos($SESSION->wantsurl, '/tool/mobile/launch.php') === false) {
96
            if (empty($SESSION->wantsurl) || strpos($SESSION->wantsurl, '/tool/mobile/launch.php') === false) {
96
                $params = json_decode($_COOKIE['tool_mobile_launch'], true);
97
                $params = json_decode($_COOKIE['tool_mobile_launch'], true);
97
                $SESSION->wantsurl = (new \moodle_url("/$CFG->admin/tool/mobile/launch.php", $params))->out(false);
98
                $SESSION->wantsurl = (new \moodle_url("/$CFG->admin/tool/mobile/launch.php", $params))->out(false);
98
            }
99
            }
99
        }
100
        }
100
 
-
 
101
        // Set Partitioned and Secure attributes to the MoodleSession cookie if the user is using the Moodle app.
-
 
102
        if (\core_useragent::is_moodle_app()) {
-
 
103
            cookie_helper::add_attributes_to_cookie_response_header(
-
 
104
                'MoodleSession' . $CFG->sessioncookie,
-
 
105
                ['Secure', 'Partitioned'],
-
 
106
            );
-
 
107
        }
-
 
108
    }
101
    }
109
}
102
}