D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
proc
/
self
/
root
/
home
/
vblioqus
/
karachi777.vip
/
images
/
494334
/
65412
/
Filename :
includes.tar
back
Copy
template-tags.php 0000644 00000015734 15151400307 0010032 0 ustar 00 <?php if( ! defined( 'ABSPATH' ) ) die ( '✋' ); function px_tag_breadcrumbs() { global $post; ?> <ol id="breadcrumbs"> <?php $separador = " / "; $list_cats = category_parents(); ?> <li><a href="<?php bloginfo('url'); ?>" title="<?php echo bloginfo('title'); ?>">Home</a> <?php echo $separador; ?> </li> <?php if( !empty($list_cats) ) { foreach($list_cats as $cat) { echo "<li>$cat ".(end($list_cats) != $cat ? $separador : '' )."</li>"; } if( $post->post_parent ) { echo '<li><a href="'.get_the_permalink( $post->post_parent ).'">'.$separador.''.get_the_title( $post->post_parent ).'</a></li>'; } } ?></ol><div></div> <?php } function px_tag_social_buttons() { global $post; if( appyn_options('single_hide_social_buttons') ) return; if( is_page() ) { $hsb = appyn_gpm( $post->ID, 'appyn_hidden_social_buttons' ); if( $hsb ) return; } $color_botones_sociales = appyn_options('social_single_color'); $output = '<div class="app-spe s2 box-social">'; $output .= '<ul class="botones_sociales' . ( ($color_botones_sociales == "color") ? ' color' : '' ) .' ">'; if( is_amp_px() ) { $output .= '<li><a target="_blank" href="http://www.facebook.com/sharer/sharer.php?u=' . get_the_permalink() . '" class="facebook" rel="noopener"><i class="fab fa-facebook-f" aria-hidden="true"></i> Facebook</a></li>'; $output .= '<li><a target="_blank" href="http://www.twitter.com/share?url=' . urlencode(get_the_title() . ': ' . get_the_permalink()) . '" class="twitter" rel="noopener"><i class="fab fa-x-twitter" aria-hidden="true"></i> Twitter</a></li>'; $output .= '<li><a target="_blank" href="http://pinterest.com/pin/create/button/?url=' . get_the_permalink() . '" class="pinterest" rel="noopener"><i class="fab fa-pinterest" aria-hidden="true"></i> Pinterest</a></li>'; $output .= '<li class="tg"><a href="tg://msg_url?url=' . get_the_permalink() . '" class="telegram" rel="noopener"><i class="fab fa-telegram" aria-hidden="true"></i> Telegram</a></li>'; $output .= '<li class="ws"><a href="whatsapp://send?text=' . urlencode(get_the_title().': '.get_permalink()) . '" data-action="share/whatsapp/share" class="whatsapp" rel="noopener"><i class="fab fa-whatsapp" aria-hidden="true"></i> Whatsapp</a></li>'; } else { $output .= '<li><a href="http://www.facebook.com/sharer/sharer.php?u=' . get_the_permalink() . '" data-width="700" data-height="550" class="facebook" rel="noopener"><i class="fab fa-facebook-f" aria-hidden="true"></i> Facebook</a></li>'; $output .= '<li><a href="http://www.twitter.com/share?url=' . urlencode(get_the_title() . ': ' . get_the_permalink()) . '" class="twitter" target="_blank"><i class="fab fa-x-twitter" aria-hidden="true"></i> Twitter</a></li>'; $output .= '<li><a href="http://pinterest.com/pin/create/button/?url=' . get_the_permalink() . '" class="pinterest" target="_blank"><i class="fab fa-pinterest" aria-hidden="true"></i> Pinterest</a></li>'; $output .= '<li class="tg"><a href="https://t.me/share/url?url=' . get_the_permalink() . '" class="telegram" target="_blank"><i class="fab fa-telegram" aria-hidden="true"></i> Telegram</a></li>'; $output .= '<li class="ws"><a href="https://wa.me/?text=' . urlencode(get_the_title().': '.get_permalink()) .'" class="whatsapp" target="_blank"><i class="fab fa-whatsapp" aria-hidden="true"></i> Whatsapp</a></li>'; } $output .= '</ul></div>'; echo $output; } function px_header_social() { $output = '<ul class="social">'; $px_social_facebook = px_social('facebook'); $output .= ( !empty( $px_social_facebook ) ? '<li><a href="'.$px_social_facebook.'" class="facebook" title="Facebook" target="_blank" rel="noopener"><i class="fab fa-facebook-f" aria-hidden="true"></i></a></li>': $px_social_facebook ); $px_social_twitter = px_social('twitter'); $output .= ( !empty( $px_social_twitter ) ? '<li><a href="'.$px_social_twitter.'" class="twitter" title="Twitter" target="_blank" rel="noopener"><i class="fab fa-x-twitter" aria-hidden="true"></i></a></li>': $px_social_twitter ); $px_social_instagram = px_social('instagram'); $output .= ( !empty( $px_social_instagram ) ? '<li><a href="'.$px_social_instagram.'" class="instagram" title="Instagram" target="_blank" rel="noopener"><i class="fab fa-instagram" aria-hidden="true"></i></a></li>': $px_social_instagram ); $px_social_youtube = px_social('youtube'); $output .= ( !empty( $px_social_youtube ) ? '<li><a href="'.$px_social_youtube.'" class="youtube" title="YouTube" target="_blank" rel="noopener"><i class="fab fa-youtube" aria-hidden="true"></i></a></li>': $px_social_youtube ); $px_social_pinterest = px_social('pinterest'); $output .= ( !empty( $px_social_pinterest ) ? '<li><a href="'.$px_social_pinterest.'" class="pinterest" title="Pinterest" target="_blank" rel="noopener"><i class="fab fa-pinterest" aria-hidden="true"></i></a></li>': $px_social_pinterest ); $px_social_telegram = px_social('telegram'); $output .= ( !empty( $px_social_telegram ) ? '<li><a href="'.$px_social_telegram.'" class="telegram" title="Telegram" target="_blank" rel="noopener"><i class="fab fa-telegram" aria-hidden="true"></i></a></li>': $px_social_telegram ); $output .= '</ul>'; return $output; } function app_developer() { global $post; $developer = get_datos_info( 'desarrollador', false, $post->ID ); $output = ''; if( !empty($developer) ) { $output = '<span class="developer">'.$developer.'</span>'; } else { $dev_terms = wp_get_post_terms( $post->ID, 'dev', array('fields' => 'all')); if( !empty($dev_terms) ) { $output = '<span class="developer">'.$dev_terms[0]->name.'</span>'; } } return $output; } function app_date() { global $post; $appyn_post_date = appyn_options( 'post_date' ); $appyn_post_date_type = appyn_options( 'post_date_type' ); if( !$appyn_post_date && $post->post_type != 'blog' ) return; $date = get_the_date( get_option( 'date_format' ), $post->ID); if( $appyn_post_date_type == 1 ) { $date_change = array( 'enero' => '01', 'febrero' => '02', 'marzo' => '03', 'abril' => '04', 'mayo' => '05', 'junio' => '06', 'julio' => '07', 'agosto' => '08', 'setiembre' => '09', 'octubre' => '10', 'noviembre' => '11', 'diciembre' => '12', ' de ' => '-', ); $fa = get_datos_info( 'fecha_actualizacion', false, $post->ID ); if( !empty($fa) ) { $date = date_i18n( get_option( 'date_format' ), strtotime(strtr($fa, $date_change))); } } $output = '<span class="app-date">'.$date.'</span>'; return $output; } function app_version() { global $post; $version = get_datos_info( 'version', false, $post->ID ); return $version ? '<span class="version">'.px_post_mod().'<span>'.$version.'</span></span>' : ''; } widget-ultimos-posts-blog.php 0000644 00000005271 15151400307 0012322 0 ustar 00 <?php if( ! defined( 'ABSPATH' ) ) die ( '✋' ); class ultimos_posts_blog_Widget extends WP_Widget { public function __construct() { parent::__construct( 'ultimos_posts_blog_widget', '[Appyn] '.__( 'Últimos posts', 'appyn' ).' - BLOG', array('description' => __( 'Muestra los últimos posts de tu sitio', 'appyn' ),) ); } public function widget($args, $instance) { extract($args); $title = ''; if( isset($instance['title']) ){ $title = apply_filters('widget_title', $instance['title']); } else { $title = __( 'Últimos posts', 'appyn' ); } echo $before_widget; echo $before_title.$title.$after_title; echo '<div class="widget-content">'; global $wpdb, $post; $n = 0; $args = array('post_type' => 'blog', 'orderby' => 'post_date', 'ignore_sticky_posts' => 1); if( ! empty($instance['cantidad']) ) { $args['posts_per_page'] = ( $instance['cantidad'] ) ? $instance['cantidad'] : 5; } $query = new WP_Query($args); echo '<ul>'; if( $query->have_posts() ) { while($query->have_posts()): $query->the_post(); get_template_part('template-parts/loop/blog-widget'); endwhile; } else { echo '<span class="noentry">'.__( 'No hay entradas', 'appyn' ).'</span>'; } echo '</ul></div>'; wp_reset_query(); echo $after_widget; } public function update($new_instance, $old_instance) { $instance = array(); $instance['title'] = strip_tags($new_instance['title']); $instance['cantidad'] = strip_tags($new_instance['cantidad']); if(!is_numeric(strip_tags($new_instance['cantidad']))){ $instance['cantidad'] = '0'; } return $instance; } public function form($instance) { $defaults = array( 'title' => __( 'Últimos posts' , 'appyn' ), 'cantidad' => 5 ); $instance = wp_parse_args( (array) $instance, $defaults ); ?> <p> <label for="<?php echo $this->get_field_id('title'); ?>"><?php echo __( 'Título', 'appyn' ); ?>:</label> <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo esc_attr($instance["title"]); ?>" /> </p> <p> <label for="<?php echo $this->get_field_id('cantidad'); ?>"><?php echo __( 'Número de entradas a mostrar', 'appyn' ); ?>:</label> <input id="<?php echo $this->get_field_id('cantidad'); ?>" name="<?php echo $this->get_field_name('cantidad'); ?>" type="text" value="<?php echo esc_attr($instance["cantidad"]); ?>" size="3" maxlength="2" /> </p> <?php } } add_action('widgets_init', function() { register_widget("ultimos_posts_blog_Widget"); }); widget-categories.php 0000644 00000006456 15151400307 0010672 0 ustar 00 <?php if( ! defined( 'ABSPATH' ) ) die ( '✋' ); class px_custom_categories_Widget extends WP_Widget { public function __construct() { parent::__construct( 'px_custom_categories_widget', '[Appyn] '.__( 'Categorías', 'appyn' ), array('description' => __( 'Muestra las categorías', 'appyn' ),) ); } public function widget($args, $instance) { extract($args); $title = ''; if( isset($instance['title']) ){ $title = apply_filters('widget_title', $instance['title']); } else { $title = __( 'Categorías', 'appyn' ); } $sc = ( isset($instance['select_category']) ) ? $instance['select_category'] : array(); echo $before_widget; echo $before_title.$title.$after_title; echo '<div class="widget-content">'; $categories = get_categories(); echo '<ul class="pxccat columns-'.((isset($instance['columns'])) ? $instance['columns'] : 1).'">'; foreach($categories as $key => $category) { if( count($sc) > 0 ) if( ! in_array( $category->term_id, $sc ) ) continue; $icon = get_term_meta( $category->term_id, 'px_cat_icon', true ); echo '<li><a href="'.get_term_link($category->term_id).'"><span class="icop '.$icon.'"></span><span>'.$category->name.'</span></a></li>'; } echo '</ul></div>'; echo $after_widget; } public function update($new_instance, $old_instance) { $instance = array(); $instance['title'] = strip_tags($new_instance['title']); $instance['columns'] = strip_tags($new_instance['columns']); $instance['select_category'] = isset($new_instance['select_category']) ? $new_instance['select_category'] : array(); return $instance; } public function form($instance) { $defaults = array( 'title' => __( 'Categorías' , 'appyn' ), 'columns' => 1, 'select_category' => array() ); $instance = wp_parse_args( (array) $instance, $defaults ); ?> <p> <label for="<?php echo $this->get_field_id('title'); ?>"><?php echo __( 'Título', 'appyn' ); ?>:</label> <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo esc_attr($instance["title"]); ?>" /> </p> <p> <label for="<?php echo $this->get_field_id('columns'); ?>"><?php echo __( 'Columnas', 'appyn' ); ?>:</label> <input id="<?php echo $this->get_field_id('columns'); ?>" name="<?php echo $this->get_field_name('columns'); ?>" type="number" value="<?php echo esc_attr($instance["columns"]); ?>" size="1" min="1" max="2" maxlength="1" /> </p> <p> <label for="<?php echo $this->get_field_id('sc'); ?>"><?php echo __( 'Escoger categorías', 'appyn' ); ?>:</label> <button type="button" id="select_all_categories" class="button"><?php echo __( 'Seleccionar todos', 'appyn' ); ?></button> <ul class="px-scat"> <?php $categories = get_categories(); foreach( $categories as $key => $category ) { echo '<li><label><input type="checkbox" name="'.$this->get_field_name('select_category[]').'" value="'.$category->term_id.'" '. ( in_array( $category->term_id, $instance['select_category'] ) ? ' checked' : '' ) .'> '.$category->name.'</label></li>'; } ?> </ul> </p> <?php } } add_action('widgets_init', function() { register_widget("px_custom_categories_Widget"); }); class-list-table-atul.php 0000644 00000016151 15151400307 0011363 0 ustar 00 <?php if( ! defined( 'ABSPATH' ) ) die ( '✋' ); if ( ! class_exists( 'WP_List_Table' ) ) { require_once( ABSPATH . 'wp-admin/includes/class-wp-list-table.php' ); } class List_Table_ATUL extends WP_List_Table { var $total_posts; var $posts; var $has_title = false; public function __construct() { parent::__construct( [ 'singular' => 'app_to_update', 'plural' => 'apps_to_update', 'ajax' => false ] ); $posts = get_option( 'trans_updated_apps', null ); if( ! $posts ) return; if( is_string($posts) ) { $this->posts = $posts; return; } foreach( $posts as $k => $p ) { if( ! isset($p['post_title']) ) continue; $this->has_title = true; } if( !$this->has_title ) { px_process_list_apps(); $posts = get_option( 'trans_updated_apps' ); } $s = ( isset($_GET['s']) ) ? $_GET['s'] : ''; if( $s ) { foreach( $posts as $k => $p ) { if( strpos(strtolower($p['post_title']), $s) === false ) { unset($posts[$k]); } } } $this->posts = $posts; $this->total_posts = ($posts) ? count($posts) : 0; } public function get_apps_to_update( $per_page = 20, $page_number = 1 ) { $posts = $this->posts; if( !$posts ) return; if( is_string($posts) ) { $this->posts = $posts; return; } foreach( $posts as $key => $p ) { $posts[$key]['app_id'] = $key; } $offset = ($page_number - 1) * $per_page; usort($posts, function($a, $b) { return $b['update'] <=> $a['update']; }); if( ! empty( $_REQUEST['orderby'] ) ) { if( $_REQUEST['orderby'] == "updated_date" ) { if( $_REQUEST['order'] == "asc" ) { usort($posts, function($a, $b) { return $a['update'] <=> $b['update']; }); } } } $posts = array_slice($posts, $offset, $per_page); return $posts; } function column_cb($item){ return sprintf( '<input type="checkbox" name="%1$s[]" value="%2$s" />', 'apps_to_import', $item['post_id'] ); } public function no_items() { echo ( $this->posts ) ? $this->posts : __( 'No hay apps para actualizar', 'appyn' ); } public function column_default( $item, $column_name ) { switch ( $column_name ) { case 'post_title': $modtext = ( appyn_gpm( $item['post_id'], 'app_type' ) == 1 ) ? '<div><span class="modapp">MOD</span></div>' : ''; return '<div><span><img src="'.( ( has_post_thumbnail( $item['post_id']) ) ? get_the_post_thumbnail_url( $item['post_id'], 'miniatura' ) : px_noimage(true) ).'" width="50"></span> <a href="'.get_edit_post_link( $item['post_id'] ).'" target="_blank" title="'. __( 'Editar post', 'appyn' ) .'">'.$item[$column_name].'</a>'.$modtext.'<a href="https://play.google.com/store/apps/details?id='.$item['app_id'].'" target="_blank" title="'. __( 'Ver en Google Play', 'appyn' ) .'"><img alt="" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA8AAAAQCAMAAAD+iNU2AAAAyVBMVEUAAAAAzf8A/i//2AAA/2L/Plj/MjMA4P8Ayf8AxP8A/yv/MTAA9EwA0v8A+ScA0v/+Q03/My3/1QD/0AD/0wD/3AAA/wD/CgMA/yn/MjMA/y7/MDAA/zf/JTH/1gAA/wD/CAP/0wAA/y7/MTEA/y0Azv8Ay/8A+EoAxf8A/wD/CwP/1gAA5/8A5f8A2v//Pkn/OkP/0QAAwf8A1/0A1fsA/yoA/0H/DTz/KTj/NzP/MzP/AA7/9wD/6QDx6QD02QD/ygD/xAD/swCt0I1nAAAAJXRSTlMA8f0t/v708fHx7OLe29rY1s7EurWtrKGShXZoWEpAKiMdFxAJTZezOAAAAItJREFUCNdNzlcWgyAQBdBJTO+990RMIIKY3qP7X5QoeGD+7jvToFlbglll5Aw2hjN75BxGO207DrIT7SS4VGapVXBtLFLLkR/vWMq2T3PfPyGkK42Ofj58c8L7wjHP3usefHpr0S+JH7e2Jfch9+ThZ3Wu7gkyXJiCqpJLGR7r/4uUDbeaUG+tDEEEzLgTqZH0pKcAAAAASUVORK5CYII=" alt="Google Play" style="height:10px;"></a></div>'; break; case 'current_version': $di = get_post_meta( $item['post_id'], 'datos_informacion', true ); $current_version = isset($di['version']) ? $di['version'] : ''; return $current_version; break; case 'version': return $item[$column_name]; break; case 'updated_date': $results = get_option( 'trans_updated_apps' ); foreach( $results as $app ) { if( $app['post_id'] == $item['post_id'] ) return date( 'Y/m/d H:i', strtotime($app['update']) ); } break; case 'update': return '<div><a href="javascript:void(0);" data-uid="'.uniqid(true).'" data-post-id="'.$item['post_id'].'" class="button button-secondary app_import">'.__( 'Actualizar', 'appyn' ).'</a></div>'; break; default: return ''; } } public function get_columns() { $columns = [ 'cb' => '<input type="checkbox" />', 'post_title' => __( 'App', 'appyn' ), 'current_version' => __( 'Versión actual', 'appyn' ), 'version' => __( 'Nueva Versión', 'appyn' ), 'updated_date' => __( 'Fecha de actualización', 'appyn' ), 'update' => '', ]; return $columns; } public function get_sortable_columns() { $sortable_columns = array( 'updated_date' => array( 'updated_date', true ) ); return $sortable_columns; } public function get_bulk_actions() { return array( 'update' => __( 'Actualizar', 'appyn' ), ); } public function search_box( $text, $input_id ) { $input_id = $input_id . '-search-input'; if ( ! empty( $_REQUEST['orderby'] ) ) { echo '<input type="hidden" name="orderby" value="' . esc_attr( $_REQUEST['orderby'] ) . '" />'; } if ( ! empty( $_REQUEST['order'] ) ) { echo '<input type="hidden" name="order" value="' . esc_attr( $_REQUEST['order'] ) . '" />'; } if ( ! empty( $_REQUEST['post_mime_type'] ) ) { echo '<input type="hidden" name="post_mime_type" value="' . esc_attr( $_REQUEST['post_mime_type'] ) . '" />'; } if ( ! empty( $_REQUEST['detached'] ) ) { echo '<input type="hidden" name="detached" value="' . esc_attr( $_REQUEST['detached'] ) . '" />'; } ?> <p class="search-box"> <label class="screen-reader-text" for="<?php echo esc_attr( $input_id ); ?>"><?php echo $text; ?>:</label> <input type="search" id="<?php echo esc_attr( $input_id ); ?>" name="s" value="<?php _admin_search_query(); ?>" /> <?php submit_button( $text, '', '', false, array( 'id' => 'search-submit' ) ); ?> </p> <?php } public function prepare_items() { $columns = $this->get_columns(); $hidden = array( 'id' ); $sortable = $this->get_sortable_columns(); $this->_column_headers = array( $columns, $hidden, $sortable ); $per_page = $this->get_items_per_page( 'apps_to_update_per_page', 20 ); $current_page = $this->get_pagenum(); $total_items = $this->total_posts ? $this->total_posts : 0; $this->set_pagination_args( [ 'total_items' => $total_items, 'per_page' => $per_page, ] ); echo '<ul class="subsubsub"> <li class="all"><a href="'.remove_query_arg( 's' ).'"'.(! get_query_var('s') ? ' class="current"' : '').'>'.__( 'Todos', 'appyn' ).' <span class="count">('.$total_items.')</span></a></li> </ul>'; $this->items = self::get_apps_to_update( $per_page, $current_page ); } } class-upload-apk.php 0000644 00000054253 15151400307 0010422 0 ustar 00 <?php if( ! defined( 'ABSPATH' ) ) die ( '✋' ); class UploadAPK { private $urlapk; private $post_id; private $idps; private $datos_download; private $uploaddir; private $files; private $lsa; private $da; private $op; private $curl; private $range; private $has_size; private $filename; private $filename_original; private $total_parts; private $filenames_parts; private $uploadfile; private $uploadfile_temp; private $uploadfile_original; private $uploadURL; private $uploadURL_original; public $filetype; private $direct_url; private $temp_file; private $part; private $shrt; private $uid; private $total_size; private $is_mod; public function __construct( $post_id, $idps, $apk, $update, $range, $total_parts, $part = 0, $has_size = false, $uid = '', $total_size ) { $this->urlapk = $apk; $this->post_id = $post_id; $this->idps = $idps; $this->datos_download = array(); $this->uploaddir = wp_upload_dir(); $this->lsa = px_last_slug_apk(); $this->da = ( !empty($update) ? "-".date('d-m-Y', $update) : ''); $this->op = 1; $this->range = $range; $this->has_size = $has_size; $this->part = $part; $this->uid = $uid; $this->total_size = $total_size; $app_type = get_post_meta( $this->post_id, 'app_type', true ); $this->is_mod = ( $app_type == 1 ) ? true : false; $this->shrt = ( $this->is_mod == 1 ) ? appyn_options( 'mod_apps_sapk_shortlink', true ) : appyn_options( 'edcgp_sapk_shortlink', true ); if( $this->checkAPK_OBB() ) { $ext = '.zip'; $this->temp_file = tempnam(sys_get_temp_dir(), "zip"); } else { $n = array_keys($this->urlapk); $ext = ".apk"; $this->filetype = $n[0]; if( $this->filetype == "zip" ) { $ext = ".zip"; } $this->direct_url = $this->urlapk[$n[0]]; $this->temp_file = $this->direct_url; } $this->filename = sanitize_title($this->idps)."{$this->da}{$this->lsa}{$ext}"; $this->filename_original = $this->filename; if( $total_parts >= 2 && $part > 0 ) { $this->filename = sanitize_title($this->idps)."{$this->da}{$this->lsa}-part{$part}{$ext}"; $this->total_parts = $total_parts; $this->filenames_parts = array(); for( $i=1; $i<=$total_parts; $i++ ) { $this->filenames_parts[] = WP_TEMP_DIR . '/' . sanitize_title($this->idps)."{$this->da}{$this->lsa}-part{$i}{$ext}"; } } $this->uploadfile_original = WP_TEMP_DIR . '/' . $this->filename_original; $this->uploadfile = $this->uploaddir['path'] . '/' . $this->filename; $this->uploadfile_temp = WP_TEMP_DIR . '/' . $this->filename; if( $this->shrt ) { if( ! appyn_options( 'shortlink_'.$this->shrt ) ) { throw new Exception( __( 'ERROR: El acortador seleccionado no tiene la API Key...', 'appyn' ) ); exit; } } } private function uploadTo() { $edcgpss = get_option( 'appyn_edcgp_sapk_server', 1 ); if( $this->is_mod ) { $edcgpss = appyn_options( 'mod_apps_upload_server' ); } switch( $edcgpss ) { case 1: $upload = $this->uploadToWP(); break; case 2: $upload = $this->uploadToGDrive(); break; case 3: $upload = $this->uploadToDropbox(); break; case 4: $upload = $this->uploadToFTP(); break; case 5: $upload = $this->uploadTo1Fichier(); break; case 6: $upload = $this->uploadToOneDrive(); break; case 7: $upload = $this->uploadToTelegram(); break; } sleep(5); delete_option( 'file_progress_'.$this->uid ); return $upload; } private function getFileSizeHeaders( $url = null ) { if( !$url ) { $url = $this->direct_url; } if( file_exists($this->uploadfile) ) unlink( $this->uploadfile ); if( $headers = get_headers($url, 1) ) { $headers = array_change_key_case($headers); if( isset($headers['content-length']) ){ return $headers['content-length']; } } $ch = curl_init($url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_HEADER, 1); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); curl_setopt($ch, CURLOPT_NOBODY, TRUE); curl_setopt($ch, CURLOPT_TIMEOUT, 60); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET'); curl_exec($ch); $content_length = curl_getinfo($ch, CURLINFO_CONTENT_LENGTH_DOWNLOAD); if( curl_errno($ch) ) { throw new Exception("ERROR: " .curl_error($ch)); exit; } if( isset($content_length) ){ return $content_length; } else { return $this->getFileSizeHeaders( $url ); } } private function combine_parts() { $fp = fopen($this->uploadfile_original, 'w'); foreach( $this->filenames_parts as $fnp ) { $fgc = file_get_contents($fnp); fwrite( $fp, $fgc ); } fclose($fp); } public function uploadFile() { if( $this->checkAPK_OBB() ) { $this->saveFilesToZip(); copy( $this->temp_file, $this->uploadfile_original ); $upload = $this->uploadTo(); } else { if( $this->has_size ) { $filesize = $this->getFileSizeHeaders(); } else { $filesize = $this->total_size; } $a = array(); if( isset($this->filenames_parts) ) { foreach ($this->filenames_parts as $f) { $a['files'][] = array( 'name' => $f, ); } if( $this->has_size ) { $a['totalsize'] = (is_array($filesize)) ? end($filesize) : $filesize; } else { $a['totalsize'] = $filesize; } } else { $a['name'] = WP_TEMP_DIR . '/' . $this->filename; if( $this->has_size ) { $a['filesize'] = (is_array($filesize)) ? end($filesize) : $filesize; } } update_option( 'file_progress_'.$this->uid, $a ); $args = array( 'timeout' => 99999, 'user-agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:20.0) Gecko/20100101 Firefox/20.0', 'stream' => true, 'filename' => WP_TEMP_DIR . '/' . $this->filename ); if( $this->has_size ) { $args['headers'] = array( "Range" => "bytes=".$this->range[0]."-".$this->range[1], 'accept-ranges' => 'bytes'); } $tr = $this->range[1] - $this->range[0]; if( $this->part >= 2 ) { $rdv = $tr + 1; } if( $this->part == 1 ) { $rdv = $tr + 1; } if( $this->part == $this->total_parts ) { $rdv -= 1; } if( wp_remote_get( $this->temp_file, $args ) ) { $filesize_ = filesize($this->uploadfile_temp); $a['filesize'] = $filesize_; update_option( 'file_progress_'.$this->uid, $a ); if( $this->total_parts > 0 ) { if( filesize($this->uploadfile_temp) !== $rdv ) { echo json_encode(array('reupload' => true)); exit; } } } if( $this->has_size ) { if( $this->range[1] != $filesize ) { exit; } } if( $this->total_parts > 0 ) $this->combine_parts(); if( $this->has_size ) { if( filesize($this->uploadfile_original) != $filesize ) { throw new Exception('Error: Size does not match....'); exit; } } $upload = $this->uploadTo(); } if( isset($upload['error']) ) { return array('error' => sprintf( __( 'Error: %s', 'appyn' ), $upload['error']) ); } if( ! $upload || ! $upload['url'] ) { return array('error' => sprintf( __( 'Error: %s', 'appyn' ), __( 'Ocurrió un problema con el servidor de carga', 'appyn') ) ); } $this->uploadURL = $upload['url']; $this->updatePostMeta(); return $this->uploadURL; } private function checkAPK_OBB() { if( count($this->urlapk) < 2 ) return false; return ( array_key_exists('apk', $this->urlapk) && ( array_key_exists('obb', $this->urlapk) || array_key_exists('apk_2', $this->urlapk) ) ) ? true : false; } private function checkFileSize() { $filesize = (int) filesize($this->uploadfile_original); if( $filesize == 0 ) { return array('error' => __( 'El archivo pesa 0KB. No fue descargado ni subido', 'appyn' ) ); } else { return $filesize; } } private function uploadToWP() { $attach_id = attachment_url_to_postid( $this->uploaddir['url'] . '/' . $this->filename_original ); $wp_filetype = wp_check_filetype(basename($this->filename_original), null ); $attachment = array( 'post_mime_type' => strip_tags($wp_filetype['type']), 'post_title' => $this->filename_original, 'post_content' => '', 'post_status' => 'inherit' ); if( $attach_id ) { $attach_id = wp_update_attachment_metadata( $attach_id, $attachment ); } else { $attach_id = wp_insert_attachment( $attachment, ltrim($this->uploaddir['subdir'], '/') . '/' . $this->filename_original, $this->post_id ); } $fileContent = $this->checkFileSize(); if( isset($fileContent['error']) ) { if( $this->op > 2 ) { return $fileContent; } else { sleep(2000); $this->op++; return $this->uploadToWP(); } } copy( $this->uploadfile_original, $this->uploaddir['path']. '/' . $this->filename_original ); $url = $this->uploaddir['url'] . '/' . $this->filename_original; $this->uploadURL_original = $url; if( $this->shrt ) $url = px_shorten_download_link( $url, $this->shrt ); return array( 'url' => $url ); } private function uploadToDropbox() { if( !get_option('appyn_dropbox_result', null) ) { return array('error' => __( 'Falta la conexión con Dropbox', 'appyn' ) ); } $fileContent = $this->checkFileSize(); if( isset($fileContent['error']) ) { if( $this->op > 2 ) { return $fileContent; } else { sleep(2000); $this->op++; return $this->uploadToDropbox(); } } $dropbox = new TPX_Dropbox(); $upload = $dropbox->Upload( $this->uploadfile_original ); $this->uploadURL_original = $upload['url']; if( $this->shrt ) $upload['url'] = px_shorten_download_link( $upload['url'], $this->shrt ); return $upload; } private function uploadToGDrive() { if( !get_option('appyn_gdrive_token', null) ) { return array('error' => __( 'No ha realizado la conexión a Google Drive', 'appyn' ) ); } $fileContent = $this->checkFileSize(); if( isset($fileContent['error']) ) { if( $this->op > 2 ) { return $fileContent; } else { sleep(2000); $this->op++; return $this->uploadToGDrive(); } } $gdrive = new TPX_GoogleDrive(); $d = appyn_options( 'gdrive_folder', true ); $folder_id = ($d) ? $gdrive->createFolder( $d ) : null; $upload = $gdrive->insertFileToDrive( $this->uploadfile_original, $this->filename_original, $folder_id ); $this->uploadURL_original = $upload['url']; if( $this->shrt ) $upload['url'] = px_shorten_download_link( $upload['url'], $this->shrt ); return $upload; } public function deleteFile() { if( $this->total_parts > 0 ) { foreach( $this->filenames_parts as $fnp ) { unlink($fnp); } } unlink($this->uploadfile_original); } private function uploadToFTP() { if( !appyn_options( 'ftp_name_ip', true ) || !appyn_options( 'ftp_username', true ) || !appyn_options( 'ftp_password', true ) || !appyn_options( 'ftp_url', true ) ) { return array('error' => __( 'Complete los campos para la conexión FTP', 'appyn' ) ); } $fileContent = $this->checkFileSize(); if( isset($fileContent['error']) ) { if( $this->op > 2 ) { return $fileContent; } else { sleep(2000); $this->op++; return $this->uploadToFTP(); } } $ftp = new FTP(); $upload = $ftp->Upload( $this->uploadfile_original, $this->filename_original ); $this->uploadURL_original = $upload['url']; if( $this->shrt ) $upload['url'] = px_shorten_download_link( $upload['url'], $this->shrt ); return $upload; } private function uploadTo1Fichier() { if( !appyn_options( '1fichier_apikey', true ) ) { return array('error' => __( 'Coloque el API Key de 1Fichier', 'appyn' ) ); } $fileContent = $this->checkFileSize(); if( isset($fileContent['error']) ) { if( $this->op > 2 ) { return $fileContent; } else { sleep(2000); $this->op++; return $this->uploadTo1Fichier(); } } try { $fichier = new fichier(); $upload = $fichier->Upload( $this->uploadfile_original, $this->filename_original ); } catch (Exception $e) { return array('error' => $e->getMessage()); } $this->uploadURL_original = $upload['url']; if( $this->shrt ) $upload['url'] = px_shorten_download_link( $upload['url'], $this->shrt ); return $upload; } private function uploadToOneDrive() { if( !appyn_options('onedrive_access_token', null) ) { return array('error' => __( 'No ha realizado la conexión a OneDrive', 'appyn' ) ); } $fileContent = $this->checkFileSize(); if( isset($fileContent['error']) ) { if( $this->op > 2 ) { return $fileContent; } else { sleep(2000); $this->op++; return $this->uploadToOneDrive(); } } try { $onedrive = new TPX_OneDrive(); $upload = $onedrive->uploadFile( $this->uploadfile_original, $this->filename_original ); } catch (Exception $e) { return array('error' => $e->getMessage()); } $this->uploadURL_original = $upload['url']; if( $this->shrt ) $upload['url'] = px_shorten_download_link( $upload['url'], $this->shrt ); return $upload; } private function uploadToTelegram() { if( ! appyn_options( 'telegram_token', null ) || ! appyn_options( 'telegram_chatid', null ) ) { return array('error' => __( 'Coloque el token y el ID de chat', 'appyn' ) ); } $botToken = appyn_options( 'telegram_token' ); $chatId = appyn_options( 'telegram_chatid' ); $filePath = $this->uploadfile_original; $telegramApiUrl = "https://api.telegram.org/bot$botToken/sendDocument"; $postFields = array( 'chat_id' => $chatId, 'document' => new CURLFile($filePath), 'caption' => $this->filename_original ); $headers = array( 'Content-Type: multipart/form-data', ); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $telegramApiUrl); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $postFields); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $response = curl_exec($ch); $upload = array(); if( $response === false ) { return array('error' => curl_error($ch) ); } else { $response = json_decode($response, true); if( isset($response['error_code']) ) { return array('error' => $response['description'] ); } $fileId = $response['result']['document']['file_id']; $getFileUrl = "https://api.telegram.org/bot$botToken/getFile?file_id=$fileId"; $args = array( 'timeout' => 99999, 'user-agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:20.0) Gecko/20100101 Firefox/20.0'); $response = wp_remote_get( $getFileUrl, $args ); if ( is_wp_error( $response ) ) { return array('error' => __( 'Ocurrió un problema con el servidor de carga', 'appyn') ); } $c = wp_remote_retrieve_body( $response ); $data = json_decode($c, true); if( $data && isset($data['ok']) && $data['ok'] === true && isset($data['result']['file_path']) ) { $filePath = $data['result']['file_path']; $upload['url'] = "https://api.telegram.org/file/bot$botToken/$filePath"; } elseif( isset($data['ok']) && $data['ok'] === false ) { return array('error' => $data['description'] ); } } curl_close($ch); $this->uploadURL_original = $upload['url']; if( $this->shrt ) $upload['url'] = px_shorten_download_link( $upload['url'], $this->shrt ); return $upload; } private function updatePostMeta() { $this->datos_download['option'] = 'links'; $this->datos_download[0]['link'] = $this->uploadURL; if( $this->shrt ) { $this->datos_download[0]['shortlink'] = $this->uploadURL; } $this->datos_download[0]['link_original'] = $this->uploadURL_original; $this->datos_download[0]['texto'] = 'Link'; if( $this->checkAPK_OBB() ) { $this->datos_download['type'] = 'apk_obb'; } else { $this->datos_download['type'] = $this->filetype; } update_post_meta( $this->post_id, 'datos_download', $this->datos_download ); } private function saveFilesToZip() { $zip = new ZipArchive(); $zip->open($this->temp_file, ZipArchive::OVERWRITE); $apk = $this->urlapk; $arr_files = array(); $filesize = 0; $sum_file_size = 0; $i__ = 0; foreach ($apk as $type => $f) { $fname = sanitize_title($this->idps); if( $n = strstr($type, '_') ) { $fname .= $n; $type = str_replace($n, '', $type); } $fname .= ".{$type}"; $filesize = $this->getFileSizeHeaders($f); $arr_files['files'][$i__] = array( "name" => WP_TEMP_DIR . '/' . $fname, "size" => ( is_array($filesize) ) ? end($filesize) : $filesize ); $sum_file_size += ( is_array($filesize) ) ? end($filesize) : $filesize; $i__++; } $arr_files['totalsize'] = $sum_file_size; $this->files = array(); update_option( 'file_progress_'.$this->uid, $arr_files ); foreach ($apk as $type => $f) { $fname = sanitize_title($this->idps); if( $n = strstr($type, '_') ) { $fname .= $n; $type = str_replace($n, '', $type); } $fname .= ".{$type}"; $this->files[] = WP_TEMP_DIR . '/' . $fname; $fp = fopen(WP_TEMP_DIR . '/' . $fname, 'w+'); $this->curl = curl_init($f); curl_setopt($this->curl, CURLOPT_FILE, $fp); curl_setopt($this->curl, CURLOPT_FOLLOWLOCATION, true); curl_setopt($this->curl, CURLOPT_SSL_VERIFYHOST, 0); curl_setopt($this->curl, CURLOPT_SSL_VERIFYPEER, 0); curl_exec($this->curl); if( curl_errno($this->curl) ) { throw new Exception(curl_error($this->curl)); exit; } $zip->addFile(WP_TEMP_DIR . '/' . $fname, $fname); } $zip->close(); return $arr_files; } } class-shortlinks.php 0000644 00000006353 15151400307 0010563 0 ustar 00 <?php if( ! defined( 'ABSPATH' ) ) die ( '✋' ); class ShortLink { var $apikey; var $url; public function __construct( $url ) { $this->url = $url; } public function Ouo() { $this->apikey = appyn_options( 'shortlink_ouo' ); try { $api_url = "http://ouo.io/api/{$this->apikey}?s=".urlencode($this->url); $result = file_get_contents($api_url); return $result; } catch (Exception $e) { return array('error' => $e->getMessage()); } } public function shrinkEarn() { $this->apikey = appyn_options( 'shortlink_shrinkearn' ); try { $api_url = "https://shrinkearn.com/api?api={$this->apikey}&url=".urlencode($this->url); $result = json_decode(file_get_contents($api_url),TRUE); if( $result["status"] === 'error' ) { return array('error' => $result["message"]); } else { return $result["shortenedUrl"]; } } catch (Exception $e) { return array('error' => $e->getMessage()); } } public function Shorte() { $this->apikey = appyn_options( 'shortlink_shorte' ); try { $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'https://api.shorte.st/v1/data/url'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT'); curl_setopt($ch, CURLOPT_HTTPHEADER, [ 'public-api-token: '.$this->apikey, 'content-type: application/x-www-form-urlencoded', ]); curl_setopt($ch, CURLOPT_POSTFIELDS, 'urlToShorten='.urlencode($this->url)); $response = curl_exec($ch); $data = json_decode($response,TRUE); return $data['shortenedUrl']; } catch (Exception $e) { return array('error' => $e->getMessage()); } } public function ClicksFly() { $this->apikey = appyn_options( 'shortlink_clicksfly' ); try { $api_url = "https://clicksfly.com/api?api={$this->apikey}&url=".urlencode($this->url); $result = @json_decode(file_get_contents($api_url),TRUE); if( $result["status"] === 'error' ) { return array('error' => $result["message"]); } else { return $result["shortenedUrl"]; } } catch (Exception $e) { return array('error' => $e->getMessage()); } } public function Oke() { $this->apikey = appyn_options( 'shortlink_oke' ); try { $api_url = "https://oke.io/api?api={$this->apikey}&url=".urlencode($this->url); $result = @json_decode(file_get_contents($api_url),TRUE); if( $result["status"] === 'error' ) { return array('error' => $result["message"]); } else { return $result["shortenedUrl"]; } } catch (Exception $e) { return array('error' => $e->getMessage()); } } } widget-fixed.php 0000644 00000004106 15151400307 0007632 0 ustar 00 <?php if( ! defined( 'ABSPATH' ) ) die ( '✋' ); class Fixed_Widget extends WP_Widget { public function __construct() { parent::__construct( 'fixed_widget', '[Appyn] '.__( 'Widget Fijado', 'appyn' ), array('description' => __( 'Muestra un widget que sigue al usuario cuando hace scroll en la página', 'appyn' ),) ); } public function widget($args, $instance) { extract($args); $title = ''; if( isset($instance['title']) ){ $title = apply_filters('widget_title', $instance['title']); } else { $title = __( 'Widget Fijado', 'appyn' ); } echo $before_widget; echo ( !empty($title) ) ? $before_title.$title.$after_title : ''; echo '<div class="widget-content">'.$instance['content'].'</div>'; echo $after_widget; } public function update($new_instance, $old_instance) { $instance = array(); $instance['title'] = strip_tags($new_instance['title']); $instance['content'] = $new_instance['content']; return $instance; } public function form($instance) { $defaults = array( 'title' => __( 'Widget Fijado', 'appyn' ), 'content' => '' ); $instance = wp_parse_args( (array) $instance, $defaults ); ?> <p> <label for="<?php echo $this->get_field_id('title'); ?>"><?php echo __( 'Título', 'appyn' ); ?>:</label> <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo esc_attr($instance['title']); ?>" /> </p> <p> <label for="<?php echo $this->get_field_id('content'); ?>"><?php echo __( 'Contenido', 'appyn' ); ?>:</label> <textarea class="widefat" id="<?php echo $this->get_field_id('content'); ?>" name="<?php echo $this->get_field_name('content'); ?>" placeholder="<?php echo __('Se permite HTML también...', 'appyn' ); ?>" style="height: 100px; overflow: hidden; overflow-wrap: break-word; resize: none"><?php echo $instance['content']; ?></textarea> </p> <?php } } add_action('widgets_init', function() { register_widget("Fixed_Widget"); }); admin.php 0000644 00000007054 15151400307 0006347 0 ustar 00 <?php /** * Core Administration API * * @package WordPress * @subpackage Administration * @since 2.3.0 */ if ( ! defined( 'WP_ADMIN' ) ) { /* * This file is being included from a file other than wp-admin/admin.php, so * some setup was skipped. Make sure the admin message catalog is loaded since * load_default_textdomain() will not have done so in this context. */ $admin_locale = get_locale(); load_textdomain( 'default', WP_LANG_DIR . '/admin-' . $admin_locale . '.mo', $admin_locale ); unset( $admin_locale ); } /** WordPress Administration Hooks */ require_once ABSPATH . 'wp-admin/includes/admin-filters.php'; /** WordPress Bookmark Administration API */ require_once ABSPATH . 'wp-admin/includes/bookmark.php'; /** WordPress Comment Administration API */ require_once ABSPATH . 'wp-admin/includes/comment.php'; /** WordPress Administration File API */ require_once ABSPATH . 'wp-admin/includes/file.php'; /** WordPress Image Administration API */ require_once ABSPATH . 'wp-admin/includes/image.php'; /** WordPress Media Administration API */ require_once ABSPATH . 'wp-admin/includes/media.php'; /** WordPress Import Administration API */ require_once ABSPATH . 'wp-admin/includes/import.php'; /** WordPress Misc Administration API */ require_once ABSPATH . 'wp-admin/includes/misc.php'; /** WordPress Misc Administration API */ require_once ABSPATH . 'wp-admin/includes/class-wp-privacy-policy-content.php'; /** WordPress Options Administration API */ require_once ABSPATH . 'wp-admin/includes/options.php'; /** WordPress Plugin Administration API */ require_once ABSPATH . 'wp-admin/includes/plugin.php'; /** WordPress Post Administration API */ require_once ABSPATH . 'wp-admin/includes/post.php'; /** WordPress Administration Screen API */ require_once ABSPATH . 'wp-admin/includes/class-wp-screen.php'; require_once ABSPATH . 'wp-admin/includes/screen.php'; /** WordPress Taxonomy Administration API */ require_once ABSPATH . 'wp-admin/includes/taxonomy.php'; /** WordPress Template Administration API */ require_once ABSPATH . 'wp-admin/includes/template.php'; /** WordPress List Table Administration API and base class */ require_once ABSPATH . 'wp-admin/includes/class-wp-list-table.php'; require_once ABSPATH . 'wp-admin/includes/class-wp-list-table-compat.php'; require_once ABSPATH . 'wp-admin/includes/list-table.php'; /** WordPress Theme Administration API */ require_once ABSPATH . 'wp-admin/includes/theme.php'; /** WordPress Privacy Functions */ require_once ABSPATH . 'wp-admin/includes/privacy-tools.php'; /** WordPress Privacy List Table classes. */ // Previously in wp-admin/includes/user.php. Need to be loaded for backward compatibility. require_once ABSPATH . 'wp-admin/includes/class-wp-privacy-requests-table.php'; require_once ABSPATH . 'wp-admin/includes/class-wp-privacy-data-export-requests-list-table.php'; require_once ABSPATH . 'wp-admin/includes/class-wp-privacy-data-removal-requests-list-table.php'; /** WordPress User Administration API */ require_once ABSPATH . 'wp-admin/includes/user.php'; /** WordPress Site Icon API */ require_once ABSPATH . 'wp-admin/includes/class-wp-site-icon.php'; /** WordPress Update Administration API */ require_once ABSPATH . 'wp-admin/includes/update.php'; /** WordPress Deprecated Administration API */ require_once ABSPATH . 'wp-admin/includes/deprecated.php'; /** WordPress Multisite support API */ if ( is_multisite() ) { require_once ABSPATH . 'wp-admin/includes/ms-admin-filters.php'; require_once ABSPATH . 'wp-admin/includes/ms.php'; require_once ABSPATH . 'wp-admin/includes/ms-deprecated.php'; } widget-twitter.php 0000644 00000005077 15151400310 0010237 0 ustar 00 <?php if( ! defined( 'ABSPATH' ) ) die ( '✋' ); class Twitter_Widget extends WP_Widget { public function __construct() { parent::__construct( 'twitter_widget', '[Appyn] Twitter', array('description' => __( 'Coloca tu nombre de usuario de Twitter y comenzarán a seguirte', 'appyn' ),) ); } public function widget($args, $instance) { extract($args); $title = ''; if( isset($instance['title']) ){ $title = apply_filters('widget_title', $instance['title']); } else { $title = __( 'Síguenos en Twitter', 'appyn' ); } echo $before_widget; echo $before_title.$title.$after_title; $twitter_usuario = $instance['twitter_usuario']; if($twitter_usuario) { ?> <div style="text-align:center; padding:15px;"> <a href="https://twitter.com/<?php echo $twitter_usuario; ?>" class="twitter-follow-button" data-show-count="false" data-size="large">Follow @<?php echo $twitter_usuario; ?></a> <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script> </div> <?php } echo $after_widget; } public function update($new_instance, $old_instance) { $instance = array(); $instance['title'] = strip_tags($new_instance['title']); $instance['twitter_usuario'] = strip_tags($new_instance['twitter_usuario']); return $instance; } public function form($instance) { $defaults = array( 'title' => __( 'Síguenos en Twitter' , 'appyn' ), 'twitter_usuario' => '' ); $instance = wp_parse_args( (array) $instance, $defaults ); ?> <p> <label for="<?php echo $this->get_field_id('title'); ?>"><?php echo __( 'Título', 'appyn' ); ?>:</label> <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo esc_attr($instance["title"]); ?>" /> </p> <p> <label for="<?php echo $this->get_field_id('twitter_usuario'); ?>"><?php echo __( 'Usuario', 'appyn' ); ?>:</label> <input class="widefat" id="<?php echo $this->get_field_id('twitter_usuario'); ?>" name="<?php echo $this->get_field_name('twitter_usuario'); ?>" type="text" value="<?php echo esc_attr($instance["twitter_usuario"]); ?>" placeholder="@username" /> </p> <?php } } add_action('widgets_init', function() { register_widget("Twitter_Widget"); }); class-ftp.php 0000644 00000065352 15151400310 0007152 0 ustar 00 <?php /** * PemFTP - An Ftp implementation in pure PHP * * @package PemFTP * @since 2.5.0 * * @version 1.0 * @copyright Alexey Dotsenko * @author Alexey Dotsenko * @link https://www.phpclasses.org/package/1743-PHP-FTP-client-in-pure-PHP.html * @license LGPL https://opensource.org/licenses/lgpl-license.html */ /** * Defines the newline characters, if not defined already. * * This can be redefined. * * @since 2.5.0 * @var string */ if ( ! defined( 'CRLF' ) ) { define( 'CRLF', "\r\n" ); } /** * Sets whatever to autodetect ASCII mode. * * This can be redefined. * * @since 2.5.0 * @var int */ if ( ! defined( 'FTP_AUTOASCII' ) ) { define( 'FTP_AUTOASCII', -1 ); } /** * * This can be redefined. * @since 2.5.0 * @var int */ if ( ! defined( 'FTP_BINARY' ) ) { define( 'FTP_BINARY', 1 ); } /** * * This can be redefined. * @since 2.5.0 * @var int */ if ( ! defined( 'FTP_ASCII' ) ) { define( 'FTP_ASCII', 0 ); } /** * Whether to force FTP. * * This can be redefined. * * @since 2.5.0 * @var bool */ if ( ! defined( 'FTP_FORCE' ) ) { define( 'FTP_FORCE', true ); } /** * @since 2.5.0 * @var string */ define('FTP_OS_Unix','u'); /** * @since 2.5.0 * @var string */ define('FTP_OS_Windows','w'); /** * @since 2.5.0 * @var string */ define('FTP_OS_Mac','m'); /** * PemFTP base class * */ class ftp_base { /* Public variables */ var $LocalEcho; var $Verbose; var $OS_local; var $OS_remote; /* Private variables */ var $_lastaction; var $_errors; var $_type; var $_umask; var $_timeout; var $_passive; var $_host; var $_fullhost; var $_port; var $_datahost; var $_dataport; var $_ftp_control_sock; var $_ftp_data_sock; var $_ftp_temp_sock; var $_ftp_buff_size; var $_login; var $_password; var $_connected; var $_ready; var $_code; var $_message; var $_can_restore; var $_port_available; var $_curtype; var $_features; var $_error_array; var $AuthorizedTransferMode; var $OS_FullName; var $_eol_code; var $AutoAsciiExt; /* Constructor */ function __construct($port_mode=FALSE, $verb=FALSE, $le=FALSE) { $this->LocalEcho=$le; $this->Verbose=$verb; $this->_lastaction=NULL; $this->_error_array=array(); $this->_eol_code=array(FTP_OS_Unix=>"\n", FTP_OS_Mac=>"\r", FTP_OS_Windows=>"\r\n"); $this->AuthorizedTransferMode=array(FTP_AUTOASCII, FTP_ASCII, FTP_BINARY); $this->OS_FullName=array(FTP_OS_Unix => 'UNIX', FTP_OS_Windows => 'WINDOWS', FTP_OS_Mac => 'MACOS'); $this->AutoAsciiExt=array("ASP","BAT","C","CPP","CSS","CSV","JS","H","HTM","HTML","SHTML","INI","LOG","PHP3","PHTML","PL","PERL","SH","SQL","TXT"); $this->_port_available=($port_mode==TRUE); $this->SendMSG("Staring FTP client class".($this->_port_available?"":" without PORT mode support")); $this->_connected=FALSE; $this->_ready=FALSE; $this->_can_restore=FALSE; $this->_code=0; $this->_message=""; $this->_ftp_buff_size=4096; $this->_curtype=NULL; $this->SetUmask(0022); $this->SetType(FTP_AUTOASCII); $this->SetTimeout(30); $this->Passive(!$this->_port_available); $this->_login="anonymous"; $this->_password="anon@ftp.com"; $this->_features=array(); $this->OS_local=FTP_OS_Unix; $this->OS_remote=FTP_OS_Unix; $this->features=array(); if(strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') $this->OS_local=FTP_OS_Windows; elseif(strtoupper(substr(PHP_OS, 0, 3)) === 'MAC') $this->OS_local=FTP_OS_Mac; } function ftp_base($port_mode=FALSE) { $this->__construct($port_mode); } // <!-- --------------------------------------------------------------------------------------- --> // <!-- Public functions --> // <!-- --------------------------------------------------------------------------------------- --> function parselisting($line) { $is_windows = ($this->OS_remote == FTP_OS_Windows); if ($is_windows && preg_match("/([0-9]{2})-([0-9]{2})-([0-9]{2}) +([0-9]{2}):([0-9]{2})(AM|PM) +([0-9]+|<DIR>) +(.+)/",$line,$lucifer)) { $b = array(); if ($lucifer[3]<70) { $lucifer[3]+=2000; } else { $lucifer[3]+=1900; } // 4digit year fix $b['isdir'] = ($lucifer[7]=="<DIR>"); if ( $b['isdir'] ) $b['type'] = 'd'; else $b['type'] = 'f'; $b['size'] = $lucifer[7]; $b['month'] = $lucifer[1]; $b['day'] = $lucifer[2]; $b['year'] = $lucifer[3]; $b['hour'] = $lucifer[4]; $b['minute'] = $lucifer[5]; $b['time'] = @mktime($lucifer[4]+(strcasecmp($lucifer[6],"PM")==0?12:0),$lucifer[5],0,$lucifer[1],$lucifer[2],$lucifer[3]); $b['am/pm'] = $lucifer[6]; $b['name'] = $lucifer[8]; } else if (!$is_windows && $lucifer=preg_split("/[ ]/",$line,9,PREG_SPLIT_NO_EMPTY)) { //echo $line."\n"; $lcount=count($lucifer); if ($lcount<8) return ''; $b = array(); $b['isdir'] = $lucifer[0][0] === "d"; $b['islink'] = $lucifer[0][0] === "l"; if ( $b['isdir'] ) $b['type'] = 'd'; elseif ( $b['islink'] ) $b['type'] = 'l'; else $b['type'] = 'f'; $b['perms'] = $lucifer[0]; $b['number'] = $lucifer[1]; $b['owner'] = $lucifer[2]; $b['group'] = $lucifer[3]; $b['size'] = $lucifer[4]; if ($lcount==8) { sscanf($lucifer[5],"%d-%d-%d",$b['year'],$b['month'],$b['day']); sscanf($lucifer[6],"%d:%d",$b['hour'],$b['minute']); $b['time'] = @mktime($b['hour'],$b['minute'],0,$b['month'],$b['day'],$b['year']); $b['name'] = $lucifer[7]; } else { $b['month'] = $lucifer[5]; $b['day'] = $lucifer[6]; if (preg_match("/([0-9]{2}):([0-9]{2})/",$lucifer[7],$l2)) { $b['year'] = gmdate("Y"); $b['hour'] = $l2[1]; $b['minute'] = $l2[2]; } else { $b['year'] = $lucifer[7]; $b['hour'] = 0; $b['minute'] = 0; } $b['time'] = strtotime(sprintf("%d %s %d %02d:%02d",$b['day'],$b['month'],$b['year'],$b['hour'],$b['minute'])); $b['name'] = $lucifer[8]; } } return $b; } function SendMSG($message = "", $crlf=true) { if ($this->Verbose) { echo $message.($crlf?CRLF:""); flush(); } return TRUE; } function SetType($mode=FTP_AUTOASCII) { if(!in_array($mode, $this->AuthorizedTransferMode)) { $this->SendMSG("Wrong type"); return FALSE; } $this->_type=$mode; $this->SendMSG("Transfer type: ".($this->_type==FTP_BINARY?"binary":($this->_type==FTP_ASCII?"ASCII":"auto ASCII") ) ); return TRUE; } function _settype($mode=FTP_ASCII) { if($this->_ready) { if($mode==FTP_BINARY) { if($this->_curtype!=FTP_BINARY) { if(!$this->_exec("TYPE I", "SetType")) return FALSE; $this->_curtype=FTP_BINARY; } } elseif($this->_curtype!=FTP_ASCII) { if(!$this->_exec("TYPE A", "SetType")) return FALSE; $this->_curtype=FTP_ASCII; } } else return FALSE; return TRUE; } function Passive($pasv=NULL) { if(is_null($pasv)) $this->_passive=!$this->_passive; else $this->_passive=$pasv; if(!$this->_port_available and !$this->_passive) { $this->SendMSG("Only passive connections available!"); $this->_passive=TRUE; return FALSE; } $this->SendMSG("Passive mode ".($this->_passive?"on":"off")); return TRUE; } function SetServer($host, $port=21, $reconnect=true) { if(!is_long($port)) { $this->verbose=true; $this->SendMSG("Incorrect port syntax"); return FALSE; } else { $ip=@gethostbyname($host); $dns=@gethostbyaddr($host); if(!$ip) $ip=$host; if(!$dns) $dns=$host; // Validate the IPAddress PHP4 returns -1 for invalid, PHP5 false // -1 === "255.255.255.255" which is the broadcast address which is also going to be invalid $ipaslong = ip2long($ip); if ( ($ipaslong == false) || ($ipaslong === -1) ) { $this->SendMSG("Wrong host name/address \"".$host."\""); return FALSE; } $this->_host=$ip; $this->_fullhost=$dns; $this->_port=$port; $this->_dataport=$port-1; } $this->SendMSG("Host \"".$this->_fullhost."(".$this->_host."):".$this->_port."\""); if($reconnect){ if($this->_connected) { $this->SendMSG("Reconnecting"); if(!$this->quit(FTP_FORCE)) return FALSE; if(!$this->connect()) return FALSE; } } return TRUE; } function SetUmask($umask=0022) { $this->_umask=$umask; umask($this->_umask); $this->SendMSG("UMASK 0".decoct($this->_umask)); return TRUE; } function SetTimeout($timeout=30) { $this->_timeout=$timeout; $this->SendMSG("Timeout ".$this->_timeout); if($this->_connected) if(!$this->_settimeout($this->_ftp_control_sock)) return FALSE; return TRUE; } function connect($server=NULL) { if(!empty($server)) { if(!$this->SetServer($server)) return false; } if($this->_ready) return true; $this->SendMsg('Local OS : '.$this->OS_FullName[$this->OS_local]); if(!($this->_ftp_control_sock = $this->_connect($this->_host, $this->_port))) { $this->SendMSG("Error : Cannot connect to remote host \"".$this->_fullhost." :".$this->_port."\""); return FALSE; } $this->SendMSG("Connected to remote host \"".$this->_fullhost.":".$this->_port."\". Waiting for greeting."); do { if(!$this->_readmsg()) return FALSE; if(!$this->_checkCode()) return FALSE; $this->_lastaction=time(); } while($this->_code<200); $this->_ready=true; $syst=$this->systype(); if(!$syst) $this->SendMSG("Cannot detect remote OS"); else { if(preg_match("/win|dos|novell/i", $syst[0])) $this->OS_remote=FTP_OS_Windows; elseif(preg_match("/os/i", $syst[0])) $this->OS_remote=FTP_OS_Mac; elseif(preg_match("/(li|u)nix/i", $syst[0])) $this->OS_remote=FTP_OS_Unix; else $this->OS_remote=FTP_OS_Mac; $this->SendMSG("Remote OS: ".$this->OS_FullName[$this->OS_remote]); } if(!$this->features()) $this->SendMSG("Cannot get features list. All supported - disabled"); else $this->SendMSG("Supported features: ".implode(", ", array_keys($this->_features))); return TRUE; } function quit($force=false) { if($this->_ready) { if(!$this->_exec("QUIT") and !$force) return FALSE; if(!$this->_checkCode() and !$force) return FALSE; $this->_ready=false; $this->SendMSG("Session finished"); } $this->_quit(); return TRUE; } function login($user=NULL, $pass=NULL) { if(!is_null($user)) $this->_login=$user; else $this->_login="anonymous"; if(!is_null($pass)) $this->_password=$pass; else $this->_password="anon@anon.com"; if(!$this->_exec("USER ".$this->_login, "login")) return FALSE; if(!$this->_checkCode()) return FALSE; if($this->_code!=230) { if(!$this->_exec((($this->_code==331)?"PASS ":"ACCT ").$this->_password, "login")) return FALSE; if(!$this->_checkCode()) return FALSE; } $this->SendMSG("Authentication succeeded"); if(empty($this->_features)) { if(!$this->features()) $this->SendMSG("Cannot get features list. All supported - disabled"); else $this->SendMSG("Supported features: ".implode(", ", array_keys($this->_features))); } return TRUE; } function pwd() { if(!$this->_exec("PWD", "pwd")) return FALSE; if(!$this->_checkCode()) return FALSE; return preg_replace("/^[0-9]{3} \"(.+)\".*$/s", "\\1", $this->_message); } function cdup() { if(!$this->_exec("CDUP", "cdup")) return FALSE; if(!$this->_checkCode()) return FALSE; return true; } function chdir($pathname) { if(!$this->_exec("CWD ".$pathname, "chdir")) return FALSE; if(!$this->_checkCode()) return FALSE; return TRUE; } function rmdir($pathname) { if(!$this->_exec("RMD ".$pathname, "rmdir")) return FALSE; if(!$this->_checkCode()) return FALSE; return TRUE; } function mkdir($pathname) { if(!$this->_exec("MKD ".$pathname, "mkdir")) return FALSE; if(!$this->_checkCode()) return FALSE; return TRUE; } function rename($from, $to) { if(!$this->_exec("RNFR ".$from, "rename")) return FALSE; if(!$this->_checkCode()) return FALSE; if($this->_code==350) { if(!$this->_exec("RNTO ".$to, "rename")) return FALSE; if(!$this->_checkCode()) return FALSE; } else return FALSE; return TRUE; } function filesize($pathname) { if(!isset($this->_features["SIZE"])) { $this->PushError("filesize", "not supported by server"); return FALSE; } if(!$this->_exec("SIZE ".$pathname, "filesize")) return FALSE; if(!$this->_checkCode()) return FALSE; return preg_replace("/^[0-9]{3} ([0-9]+).*$/s", "\\1", $this->_message); } function abort() { if(!$this->_exec("ABOR", "abort")) return FALSE; if(!$this->_checkCode()) { if($this->_code!=426) return FALSE; if(!$this->_readmsg("abort")) return FALSE; if(!$this->_checkCode()) return FALSE; } return true; } function mdtm($pathname) { if(!isset($this->_features["MDTM"])) { $this->PushError("mdtm", "not supported by server"); return FALSE; } if(!$this->_exec("MDTM ".$pathname, "mdtm")) return FALSE; if(!$this->_checkCode()) return FALSE; $mdtm = preg_replace("/^[0-9]{3} ([0-9]+).*$/s", "\\1", $this->_message); $date = sscanf($mdtm, "%4d%2d%2d%2d%2d%2d"); $timestamp = mktime($date[3], $date[4], $date[5], $date[1], $date[2], $date[0]); return $timestamp; } function systype() { if(!$this->_exec("SYST", "systype")) return FALSE; if(!$this->_checkCode()) return FALSE; $DATA = explode(" ", $this->_message); return array($DATA[1], $DATA[3]); } function delete($pathname) { if(!$this->_exec("DELE ".$pathname, "delete")) return FALSE; if(!$this->_checkCode()) return FALSE; return TRUE; } function site($command, $fnction="site") { if(!$this->_exec("SITE ".$command, $fnction)) return FALSE; if(!$this->_checkCode()) return FALSE; return TRUE; } function chmod($pathname, $mode) { if(!$this->site( sprintf('CHMOD %o %s', $mode, $pathname), "chmod")) return FALSE; return TRUE; } function restore($from) { if(!isset($this->_features["REST"])) { $this->PushError("restore", "not supported by server"); return FALSE; } if($this->_curtype!=FTP_BINARY) { $this->PushError("restore", "cannot restore in ASCII mode"); return FALSE; } if(!$this->_exec("REST ".$from, "restore")) return FALSE; if(!$this->_checkCode()) return FALSE; return TRUE; } function features() { if(!$this->_exec("FEAT", "features")) return FALSE; if(!$this->_checkCode()) return FALSE; $f=preg_split("/[".CRLF."]+/", preg_replace("/[0-9]{3}[ -].*[".CRLF."]+/", "", $this->_message), -1, PREG_SPLIT_NO_EMPTY); $this->_features=array(); foreach($f as $k=>$v) { $v=explode(" ", trim($v)); $this->_features[array_shift($v)]=$v; } return true; } function rawlist($pathname="", $arg="") { return $this->_list(($arg?" ".$arg:"").($pathname?" ".$pathname:""), "LIST", "rawlist"); } function nlist($pathname="", $arg="") { return $this->_list(($arg?" ".$arg:"").($pathname?" ".$pathname:""), "NLST", "nlist"); } function is_exists($pathname) { return $this->file_exists($pathname); } function file_exists($pathname) { $exists=true; if(!$this->_exec("RNFR ".$pathname, "rename")) $exists=FALSE; else { if(!$this->_checkCode()) $exists=FALSE; $this->abort(); } if($exists) $this->SendMSG("Remote file ".$pathname." exists"); else $this->SendMSG("Remote file ".$pathname." does not exist"); return $exists; } function fget($fp, $remotefile, $rest=0) { if($this->_can_restore and $rest!=0) fseek($fp, $rest); $pi=pathinfo($remotefile); if($this->_type==FTP_ASCII or ($this->_type==FTP_AUTOASCII and in_array(strtoupper($pi["extension"]), $this->AutoAsciiExt))) $mode=FTP_ASCII; else $mode=FTP_BINARY; if(!$this->_data_prepare($mode)) { return FALSE; } if($this->_can_restore and $rest!=0) $this->restore($rest); if(!$this->_exec("RETR ".$remotefile, "get")) { $this->_data_close(); return FALSE; } if(!$this->_checkCode()) { $this->_data_close(); return FALSE; } $out=$this->_data_read($mode, $fp); $this->_data_close(); if(!$this->_readmsg()) return FALSE; if(!$this->_checkCode()) return FALSE; return $out; } function get($remotefile, $localfile=NULL, $rest=0) { if(is_null($localfile)) $localfile=$remotefile; if (@file_exists($localfile)) $this->SendMSG("Warning : local file will be overwritten"); $fp = @fopen($localfile, "w"); if (!$fp) { $this->PushError("get","cannot open local file", "Cannot create \"".$localfile."\""); return FALSE; } if($this->_can_restore and $rest!=0) fseek($fp, $rest); $pi=pathinfo($remotefile); if($this->_type==FTP_ASCII or ($this->_type==FTP_AUTOASCII and in_array(strtoupper($pi["extension"]), $this->AutoAsciiExt))) $mode=FTP_ASCII; else $mode=FTP_BINARY; if(!$this->_data_prepare($mode)) { fclose($fp); return FALSE; } if($this->_can_restore and $rest!=0) $this->restore($rest); if(!$this->_exec("RETR ".$remotefile, "get")) { $this->_data_close(); fclose($fp); return FALSE; } if(!$this->_checkCode()) { $this->_data_close(); fclose($fp); return FALSE; } $out=$this->_data_read($mode, $fp); fclose($fp); $this->_data_close(); if(!$this->_readmsg()) return FALSE; if(!$this->_checkCode()) return FALSE; return $out; } function fput($remotefile, $fp, $rest=0) { if($this->_can_restore and $rest!=0) fseek($fp, $rest); $pi=pathinfo($remotefile); if($this->_type==FTP_ASCII or ($this->_type==FTP_AUTOASCII and in_array(strtoupper($pi["extension"]), $this->AutoAsciiExt))) $mode=FTP_ASCII; else $mode=FTP_BINARY; if(!$this->_data_prepare($mode)) { return FALSE; } if($this->_can_restore and $rest!=0) $this->restore($rest); if(!$this->_exec("STOR ".$remotefile, "put")) { $this->_data_close(); return FALSE; } if(!$this->_checkCode()) { $this->_data_close(); return FALSE; } $ret=$this->_data_write($mode, $fp); $this->_data_close(); if(!$this->_readmsg()) return FALSE; if(!$this->_checkCode()) return FALSE; return $ret; } function put($localfile, $remotefile=NULL, $rest=0) { if(is_null($remotefile)) $remotefile=$localfile; if (!file_exists($localfile)) { $this->PushError("put","cannot open local file", "No such file or directory \"".$localfile."\""); return FALSE; } $fp = @fopen($localfile, "r"); if (!$fp) { $this->PushError("put","cannot open local file", "Cannot read file \"".$localfile."\""); return FALSE; } if($this->_can_restore and $rest!=0) fseek($fp, $rest); $pi=pathinfo($localfile); if($this->_type==FTP_ASCII or ($this->_type==FTP_AUTOASCII and in_array(strtoupper($pi["extension"]), $this->AutoAsciiExt))) $mode=FTP_ASCII; else $mode=FTP_BINARY; if(!$this->_data_prepare($mode)) { fclose($fp); return FALSE; } if($this->_can_restore and $rest!=0) $this->restore($rest); if(!$this->_exec("STOR ".$remotefile, "put")) { $this->_data_close(); fclose($fp); return FALSE; } if(!$this->_checkCode()) { $this->_data_close(); fclose($fp); return FALSE; } $ret=$this->_data_write($mode, $fp); fclose($fp); $this->_data_close(); if(!$this->_readmsg()) return FALSE; if(!$this->_checkCode()) return FALSE; return $ret; } function mput($local=".", $remote=NULL, $continious=false) { $local=realpath($local); if(!@file_exists($local)) { $this->PushError("mput","cannot open local folder", "Cannot stat folder \"".$local."\""); return FALSE; } if(!is_dir($local)) return $this->put($local, $remote); if(empty($remote)) $remote="."; elseif(!$this->file_exists($remote) and !$this->mkdir($remote)) return FALSE; if($handle = opendir($local)) { $list=array(); while (false !== ($file = readdir($handle))) { if ($file != "." && $file != "..") $list[]=$file; } closedir($handle); } else { $this->PushError("mput","cannot open local folder", "Cannot read folder \"".$local."\""); return FALSE; } if(empty($list)) return TRUE; $ret=true; foreach($list as $el) { if(is_dir($local."/".$el)) $t=$this->mput($local."/".$el, $remote."/".$el); else $t=$this->put($local."/".$el, $remote."/".$el); if(!$t) { $ret=FALSE; if(!$continious) break; } } return $ret; } function mget($remote, $local=".", $continious=false) { $list=$this->rawlist($remote, "-lA"); if($list===false) { $this->PushError("mget","cannot read remote folder list", "Cannot read remote folder \"".$remote."\" contents"); return FALSE; } if(empty($list)) return true; if(!@file_exists($local)) { if(!@mkdir($local)) { $this->PushError("mget","cannot create local folder", "Cannot create folder \"".$local."\""); return FALSE; } } foreach($list as $k=>$v) { $list[$k]=$this->parselisting($v); if( ! $list[$k] or $list[$k]["name"]=="." or $list[$k]["name"]=="..") unset($list[$k]); } $ret=true; foreach($list as $el) { if($el["type"]=="d") { if(!$this->mget($remote."/".$el["name"], $local."/".$el["name"], $continious)) { $this->PushError("mget", "cannot copy folder", "Cannot copy remote folder \"".$remote."/".$el["name"]."\" to local \"".$local."/".$el["name"]."\""); $ret=false; if(!$continious) break; } } else { if(!$this->get($remote."/".$el["name"], $local."/".$el["name"])) { $this->PushError("mget", "cannot copy file", "Cannot copy remote file \"".$remote."/".$el["name"]."\" to local \"".$local."/".$el["name"]."\""); $ret=false; if(!$continious) break; } } @chmod($local."/".$el["name"], $el["perms"]); $t=strtotime($el["date"]); if($t!==-1 and $t!==false) @touch($local."/".$el["name"], $t); } return $ret; } function mdel($remote, $continious=false) { $list=$this->rawlist($remote, "-la"); if($list===false) { $this->PushError("mdel","cannot read remote folder list", "Cannot read remote folder \"".$remote."\" contents"); return false; } foreach($list as $k=>$v) { $list[$k]=$this->parselisting($v); if( ! $list[$k] or $list[$k]["name"]=="." or $list[$k]["name"]=="..") unset($list[$k]); } $ret=true; foreach($list as $el) { if ( empty($el) ) continue; if($el["type"]=="d") { if(!$this->mdel($remote."/".$el["name"], $continious)) { $ret=false; if(!$continious) break; } } else { if (!$this->delete($remote."/".$el["name"])) { $this->PushError("mdel", "cannot delete file", "Cannot delete remote file \"".$remote."/".$el["name"]."\""); $ret=false; if(!$continious) break; } } } if(!$this->rmdir($remote)) { $this->PushError("mdel", "cannot delete folder", "Cannot delete remote folder \"".$remote."/".$el["name"]."\""); $ret=false; } return $ret; } function mmkdir($dir, $mode = 0777) { if(empty($dir)) return FALSE; if($this->is_exists($dir) or $dir == "/" ) return TRUE; if(!$this->mmkdir(dirname($dir), $mode)) return false; $r=$this->mkdir($dir, $mode); $this->chmod($dir,$mode); return $r; } function glob($pattern, $handle=NULL) { $path=$output=null; if(PHP_OS=='WIN32') $slash='\\'; else $slash='/'; $lastpos=strrpos($pattern,$slash); if(!($lastpos===false)) { $path=substr($pattern,0,-$lastpos-1); $pattern=substr($pattern,$lastpos); } else $path=getcwd(); if(is_array($handle) and !empty($handle)) { foreach($handle as $dir) { if($this->glob_pattern_match($pattern,$dir)) $output[]=$dir; } } else { $handle=@opendir($path); if($handle===false) return false; while($dir=readdir($handle)) { if($this->glob_pattern_match($pattern,$dir)) $output[]=$dir; } closedir($handle); } if(is_array($output)) return $output; return false; } function glob_pattern_match($pattern,$subject) { $out=null; $chunks=explode(';',$pattern); foreach($chunks as $pattern) { $escape=array('$','^','.','{','}','(',')','[',']','|'); while(str_contains($pattern,'**')) $pattern=str_replace('**','*',$pattern); foreach($escape as $probe) $pattern=str_replace($probe,"\\$probe",$pattern); $pattern=str_replace('?*','*', str_replace('*?','*', str_replace('*',".*", str_replace('?','.{1,1}',$pattern)))); $out[]=$pattern; } if(count($out)==1) return($this->glob_regexp("^$out[0]$",$subject)); else { foreach($out as $tester) // TODO: This should probably be glob_regexp(), but needs tests. if($this->my_regexp("^$tester$",$subject)) return true; } return false; } function glob_regexp($pattern,$subject) { $sensitive=(PHP_OS!='WIN32'); return ($sensitive? preg_match( '/' . preg_quote( $pattern, '/' ) . '/', $subject ) : preg_match( '/' . preg_quote( $pattern, '/' ) . '/i', $subject ) ); } function dirlist($remote) { $list=$this->rawlist($remote, "-la"); if($list===false) { $this->PushError("dirlist","cannot read remote folder list", "Cannot read remote folder \"".$remote."\" contents"); return false; } $dirlist = array(); foreach($list as $k=>$v) { $entry=$this->parselisting($v); if ( empty($entry) ) continue; if($entry["name"]=="." or $entry["name"]=="..") continue; $dirlist[$entry['name']] = $entry; } return $dirlist; } // <!-- --------------------------------------------------------------------------------------- --> // <!-- Private functions --> // <!-- --------------------------------------------------------------------------------------- --> function _checkCode() { return ($this->_code<400 and $this->_code>0); } function _list($arg="", $cmd="LIST", $fnction="_list") { if(!$this->_data_prepare()) return false; if(!$this->_exec($cmd.$arg, $fnction)) { $this->_data_close(); return FALSE; } if(!$this->_checkCode()) { $this->_data_close(); return FALSE; } $out=""; if($this->_code<200) { $out=$this->_data_read(); $this->_data_close(); if(!$this->_readmsg()) return FALSE; if(!$this->_checkCode()) return FALSE; if($out === FALSE ) return FALSE; $out=preg_split("/[".CRLF."]+/", $out, -1, PREG_SPLIT_NO_EMPTY); // $this->SendMSG(implode($this->_eol_code[$this->OS_local], $out)); } return $out; } // <!-- --------------------------------------------------------------------------------------- --> // <!-- Partie : gestion des erreurs --> // <!-- --------------------------------------------------------------------------------------- --> // Gnre une erreur pour traitement externe la classe function PushError($fctname,$msg,$desc=false){ $error=array(); $error['time']=time(); $error['fctname']=$fctname; $error['msg']=$msg; $error['desc']=$desc; if($desc) $tmp=' ('.$desc.')'; else $tmp=''; $this->SendMSG($fctname.': '.$msg.$tmp); return(array_push($this->_error_array,$error)); } // Rcupre une erreur externe function PopError(){ if(count($this->_error_array)) return(array_pop($this->_error_array)); else return(false); } } $mod_sockets = extension_loaded( 'sockets' ); if ( ! $mod_sockets && function_exists( 'dl' ) && is_callable( 'dl' ) ) { $prefix = ( PHP_SHLIB_SUFFIX == 'dll' ) ? 'php_' : ''; @dl( $prefix . 'sockets.' . PHP_SHLIB_SUFFIX ); // phpcs:ignore PHPCompatibility.FunctionUse.RemovedFunctions.dlDeprecated $mod_sockets = extension_loaded( 'sockets' ); } require_once __DIR__ . "/class-ftp-" . ( $mod_sockets ? "sockets" : "pure" ) . ".php"; if ( $mod_sockets ) { class ftp extends ftp_sockets {} } else { class ftp extends ftp_pure {} } widget-facebook.php 0000644 00000004532 15151400310 0010301 0 ustar 00 <?php if( ! defined( 'ABSPATH' ) ) die ( '✋' ); if( wp_is_mobile() ) return; class Facebook_Widget extends WP_Widget { public function __construct() { parent::__construct( 'facebook_widget', '[Appyn] Facebook', array('description' => __( 'Muestra la caja de tu página de Facebook', 'appyn' ),) ); } public function widget($args, $instance) { extract($args); $title = ''; if( isset($instance['title']) ){ $title = apply_filters('widget_title', $instance['title']); } else { $title = 'Facebook'; } echo $before_widget; echo $before_title.$title.$after_title; $face_url = $instance['face_url']; ?> <script async defer crossorigin="anonymous" src="https://connect.facebook.net/<?php echo get_locale(); ?>/sdk.js#xfbml=1&version=v16.0"></script> <?php echo '<div class="fb-page" data-href="'.$face_url.'" data-tabs="" data-width="280" data-height="" data-small-header="false" data-adapt-container-width="true" data-hide-cover="false" data-show-facepile="true"><blockquote cite="'.$face_url.'" class="fb-xfbml-parse-ignore"><a href="'.$face_url.'">Facebook</a></blockquote></div>'; echo $after_widget; } public function update($new_instance, $old_instance) { $instance = array(); $instance['title'] = strip_tags($new_instance['title']); $instance['face_url'] = strip_tags($new_instance['face_url']); return $instance; } public function form($instance) { $defaults = array( 'title' => __( 'Facebook' , 'appyn' ), 'face_url' => '' ); $instance = wp_parse_args( (array) $instance, $defaults ); ?> <p> <label for="<?php echo $this->get_field_id('title'); ?>"><?php echo __( 'Título', 'appyn' ); ?>:</label> <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo esc_attr($instance["title"]); ?>" /> </p> <p> <label for="<?php echo $this->get_field_id('face_url'); ?>">URL:</label> <input class="widefat" id="<?php echo $this->get_field_id('face_url'); ?>" name="<?php echo $this->get_field_name('face_url'); ?>" type="text" value="<?php echo esc_attr($instance["face_url"]); ?>" /> </p> <?php } } add_action('widgets_init', function() { register_widget("Facebook_Widget"); }); class-dropbox.php 0000644 00000021101 15151400310 0010016 0 ustar 00 <?php if( ! defined( 'ABSPATH' ) ) die ( '✋' ); class TPX_Dropbox { var $result; var $access_token; var $filename; var $max_upload; var $content; var $filesize; var $session_id; public function __construct() { $this->result = json_decode(appyn_options( 'dropbox_result', true ), true); if( appyn_options( 'dropbox_expires', true ) < time() ) { $dropbox_app_key = appyn_options( 'dropbox_app_key' ); $dropbox_app_secret = appyn_options( 'dropbox_app_secret' ); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'https://api.dropbox.com/oauth2/token'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, "grant_type=refresh_token&refresh_token=".$this->result['refresh_token']); curl_setopt($ch, CURLOPT_USERPWD, $dropbox_app_key.':'.$dropbox_app_secret); $headers = array(); $headers[] = 'Content-Type: application/x-www-form-urlencoded'; curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); $result = curl_exec($ch); if (curl_errno($ch)) { $output['error'] = curl_error($ch); return $output; } curl_close($ch); if( $result ) { $j = json_decode($result, true); if( isset($j['access_token']) ) { update_option( 'appyn_dropbox_result', $result ); update_option( 'appyn_dropbox_expires', (time()+$j['expires_in']) ); $this->result = $j; } } } $this->access_token = $this->result['access_token']; $this->max_upload = 150 * 1024 * 1024; } private function checkIfExists( $path_display ) { $curl_url = 'https://api.dropboxapi.com/2/sharing/list_shared_links'; $content = array( 'path' => $path_display, ); $result = $this->curlInit( $curl_url, json_encode( $content ), false, 'json' ); $r = json_decode( $result, true ); if( count($r['links']) > 0 ) { return str_replace('dl=0', 'dl=1', $r['links'][0]['url']); } } public function Upload( $filename ) { $this->filename = $filename; $fp = fopen($this->filename, 'rb'); $this->filesize = filesize($this->filename); if( $this->filesize < 150 * 1024 * 1024 ) { $this->content = fread($fp, $this->filesize); $dropbox_api_arg = array( "path"=> '/'.basename( $this->filename ), "mode" => "add", "autorename" => true, "mute" => false, "strict_conflict" => false ); $curl_url = 'https://content.dropboxapi.com/2/files/upload'; $result = $this->curlInit( $curl_url, $this->content, $dropbox_api_arg ); $r = json_decode($result, true); if( isset($r['error_summary']) ) { $output['error'] = $r['error_summary']; return $output; } $checkIfExists = $this->checkIfExists($r['path_display']); if( $checkIfExists ) { $output['url'] = $checkIfExists; } else { $dpd = $this->pathDisplay($r); $output['url'] = $dpd['url']; } return $output; } else { $offset = $this->max_upload; $tosend = $this->filesize; $content = fread($fp, $offset); $tosend -= $this->max_upload; $this->uploadStart($content); $offset = 0; while ($tosend > $this->max_upload) { $content = fread($fp, $this->max_upload); $offset += $this->max_upload; $tosend -= $this->max_upload; $this->uploadAppend($offset, $content); } $offset += $this->max_upload; $content = fread($fp, $tosend); fclose($fp); $result = $this->uploadFinish($offset, $content); return $result; } } private function curlInit( $curl_url, $content = '', $dropbox_api_arg = '', $type = 'octet-stream' ) { $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $curl_url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); if( !empty($content) ) { curl_setopt($ch, CURLOPT_POSTFIELDS, $content); } curl_setopt($ch, CURLOPT_POST, 1); $headers = array(); $headers[] = 'Authorization: Bearer '. $this->access_token; if( $dropbox_api_arg ) $headers[] = 'Dropbox-Api-Arg: '. json_encode($dropbox_api_arg); if( $type == 'octet-stream' ) $headers[] = 'Content-Type: application/octet-stream'; elseif( $type == 'json' ) $headers[] = 'Content-Type: application/json'; curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); $result = curl_exec($ch); if (curl_errno($ch)) { $output['error'] = "curl: ". curl_error($ch); return $output; } curl_close ($ch); return $result; } private function uploadStart($content = '') { $curl_url = 'https://content.dropboxapi.com/2/files/upload_session/start'; $dropbox_api_arg = array( "close"=> false, ); $result = $this->curlInit( $curl_url, $content, $dropbox_api_arg ); $r = json_decode($result, true); $this->session_id = $r['session_id']; if( ! $this->session_id || $this->session_id == 'None' ) { $output['error'] = __( 'Error: Token de acceso incorrecto', 'appyn' ); return $output; } return $r; } private function uploadFinish( $offset, $content ) { $output = array(); $curl_url = 'https://content.dropboxapi.com/2/files/upload_session/finish'; $dropbox_api_arg = array( "cursor" => array( "session_id" => $this->session_id, "offset" => $offset, ), "commit" => array( "path"=> '/'.basename($this->filename), "mode" => "add", "autorename" => true, "mute" => false, "strict_conflict" => false ) ); $result = $this->curlInit( $curl_url, $content, $dropbox_api_arg ); $r = json_decode($result, true); if( isset($r['error_summary']) ) { $output['error'] = $r['error_summary']; return $output; } $dpd = $this->pathDisplay($r); $output['url'] = $dpd['url']; return $output; } private function uploadAppend( $offset, $content ) { $curl_url = 'https://content.dropboxapi.com/2/files/upload_session/append_v2'; $dropbox_api_arg = array( "cursor" => array( "session_id" => $this->session_id, "offset" => $offset, ), "close" => false, ); $this->curlInit( $curl_url, $content, $dropbox_api_arg ); } private function pathDisplay($p) { $curl_url = 'https://api.dropboxapi.com/2/sharing/list_shared_links'; $content = array( 'path' => $p['id'], ); $result = $this->curlInit( $curl_url, json_encode( $content ), false, 'json' ); $r = json_decode($result, true); if( isset($r['links'][0]) ) { return str_replace('dl=0', 'dl=1', $r['links'][0]); } $curl_url = 'https://api.dropboxapi.com/2/sharing/create_shared_link_with_settings'; $content = array( 'path' => $p['path_display'], "settings" => array( "requested_visibility" => "public", "audience" => "public", "access" => "viewer", ), ); $result = $this->curlInit( $curl_url, json_encode( $content ), false, 'json' ); $r = json_decode($result, true); return $r; } } widget-mejor-calificados.php 0000644 00000010050 15151400310 0012073 0 ustar 00 <?php if( ! defined( 'ABSPATH' ) ) die ( '✋' ); class mejor_calificados_Widget extends WP_Widget { public function __construct() { parent::__construct( 'mejor_calificados_widget', '[Appyn] '.__( 'Apps mejor calificadas', 'appyn' ), array('description' => __( 'Muestra las apps mejor calificadas de tu sitio', 'appyn' ),) ); } public function widget($args, $instance) { extract($args); $title = ''; $instance = array_filter($instance); if( isset($instance['title']) ){ $title = apply_filters('widget_title', $instance['title']); } else { $title = __( 'Apps mejor calificadas', 'appyn' ); } echo $before_widget; echo $before_title.$title.$after_title; echo '<div class="widget-content">'; global $wpdb, $post; $n = 0; $args = array( 'meta_key' => 'new_rating_average', 'orderby' => 'meta_value_num', 'ignore_sticky_posts' => 1 ); if( ! empty($instance['cantidad']) ) { $args['posts_per_page'] = ( $instance['cantidad'] ) ? $instance['cantidad'] : 5; } if( ! empty($instance['categoria']) ) { $args['cat'] = array($instance['categoria']); } if( appyn_options( 'versiones_mostrar_widgets') == 1 ) { $args['post_parent'] = 0; } if( ! empty($instance['mod_apps_widget']) ) { $args['meta_query'] = array( array( 'key' => 'app_type', 'value' => array(1), 'compare' => 'IN', ) ); } $ms = new WP_Query($args); echo '<ul>'; if( $ms->have_posts() ) : while( $ms->have_posts() ) : $ms->the_post(); get_template_part('template-parts/loop/app-widget'); endwhile; else: echo '<span class="noentry">'.__( 'No hay entradas', 'appyn' ).'</span>'; endif; wp_reset_query(); echo '</ul></div>'; echo $after_widget; } public function update($new_instance, $old_instance) { $instance = array(); $instance['title'] = strip_tags($new_instance['title']); $instance['cantidad'] = strip_tags($new_instance['cantidad']); $instance['categoria'] = $new_instance['categoria']; if(!is_numeric(strip_tags($new_instance['cantidad']))){ $instance['cantidad'] = '0'; } return $instance; } public function form($instance) { $defaults = array( 'title' => __( 'Apps mejor calificadas' , 'appyn' ), 'cantidad' => 5 ); $instance = wp_parse_args( (array) $instance, $defaults ); ?> <p> <label for="<?php echo $this->get_field_id('title'); ?>"><?php echo __( 'Título', 'appyn' ); ?>:</label> <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo esc_attr($instance["title"]); ?>" /> </p> <p> <label for="<?php echo $this->get_field_id('cantidad'); ?>"><?php echo __( 'De una categoría', 'appyn' ); ?>:</label> <select name="<?php echo $this->get_field_name('categoria'); ?>"> <option value="0"><?php echo __( 'Ninguna', 'appyn' ); ?></option> <?php $categories = get_categories(); foreach($categories as $category) { if( !isset($instance['categoria']) ) continue; if($instance['categoria'] == $category->term_id) { ?> <option value="<?php echo $category->term_id; ?>" selected><?php echo $category->name; ?></option> <?php } else { ?> <option value="<?php echo $category->term_id; ?>"><?php echo $category->name; ?></option> <?php } ?> <?php } ?> </select> </p> <p> <label for="<?php echo $this->get_field_id('cantidad'); ?>"><?php echo __( 'Número de entradas a mostrar', 'appyn' ); ?>:</label> <input id="<?php echo $this->get_field_id('cantidad'); ?>" name="<?php echo $this->get_field_name('cantidad'); ?>" type="text" value="<?php echo esc_attr($instance["cantidad"]); ?>" size="3" maxlength="2" /> </p> <?php } } add_action('widgets_init', function() { register_widget("mejor_calificados_Widget"); }); class-onedrive.php 0000644 00000020307 15151400310 0010163 0 ustar 00 <?php if( ! defined( 'ABSPATH' ) ) die ( '✋' ); class TPX_OneDrive { var $client_id; var $client_secret; var $access_token; var $redirect_uri; var $refresh_token; var $file_id; var $folder_id; var $folder_name; public function __construct() { $this->client_id = appyn_options( 'onedrive_client_id', true ); $this->client_secret = appyn_options( 'onedrive_client_secret', true ); $this->access_token = appyn_options( 'onedrive_access_token', true ); $this->refresh_token = appyn_options( 'onedrive_refresh_token', true ); $this->folder_name = appyn_options( 'onedrive_folder', true ); $this->redirect_uri = get_site_url(); if( !$this->client_id || !$this->client_secret || !$this->access_token || !$this->refresh_token ) return false; $this->refreshToken(); if( !empty( $this->folder_name ) ) { $this->folder_id = $this->createFolder( $this->folder_name ); $this->folder_name = trailingslashit( appyn_options( 'onedrive_folder', true ) ); } } public function ODConnect() { $redirect = 'https://login.microsoftonline.com/common/oauth2/v2.0/authorize?client_id='.$this->client_id.'&response_type=code&redirect_uri='.$this->redirect_uri.'&scope=files.read%20files.read.all%20files.readwrite%20files.readwrite.all%20offline_access%20sites.readwrite.all'; return $redirect; } public function getToken($code) { $post = array( 'client_id' => $this->client_id, 'client_secret' => $this->client_secret, 'redirect_uri' => $this->redirect_uri, 'code' => $code, 'grant_type' => 'authorization_code', ); $headers = array(); $headers[] = 'Content-Type: application/x-www-form-urlencoded'; $data = $this->_curl( 'https://login.microsoftonline.com/common/oauth2/v2.0/token', http_build_query($post), false, $headers ); if( isset($data['error']) ) { echo '<strong>Error '.$data['error'].':</strong> '.$data['error_description']; exit; } $this->access_token = $data['access_token']; $this->refresh_token = $data['refresh_token']; update_option( 'appyn_onedrive_access_token', $this->access_token ); update_option( 'appyn_onedrive_refresh_token', $this->refresh_token ); } public function refreshToken() { $post = array( 'client_id' => $this->client_id, 'client_secret' => $this->client_secret, 'redirect_uri' => $this->redirect_uri, 'refresh_token' => $this->refresh_token, 'grant_type' => 'refresh_token', ); $headers = array(); $headers[] = 'Content-Type: application/x-www-form-urlencoded'; $data = $this->_curl( 'https://login.microsoftonline.com/common/oauth2/v2.0/token', http_build_query($post), false, $headers ); $this->access_token = $data['access_token']; $this->refresh_token = $data['refresh_token']; update_option( 'appyn_onedrive_access_token', $this->access_token ); update_option( 'appyn_onedrive_refresh_token', $this->refresh_token ); } private function createFolder( $name ) { $post = '{ "name": "'.$name.'", "folder": { }, }'; $headers = array(); $headers[] = 'Authorization: bearer '.$this->access_token; $headers[] = 'Content-Type: application/json'; $data = $this->_curl( 'https://graph.microsoft.com/v1.0/me/drive/root/children', $post, false, $headers ); return $data['id']; } private function createFile( $file_path, $file_name ) { $post = array( 'file' => '@' .realpath($file_path) ); $headers = array(); $headers[] = 'Authorization: bearer '.$this->access_token; $headers[] = 'Content-Type: application/x-www-form-urlencoded'; $headers[] = 'Content-Length: 0'; $data = $this->_curl( 'https://graph.microsoft.com/v1.0/me/drive/root:/'.$this->folder_name.$file_name.':/content', $post, true, $headers ); return $data; } public function uploadFile( $file_path, $file_name ) { $uploadfile = $this->createFile( $file_path, $file_name ); $this->file_id = $uploadfile['id']; $post = '{ "@microsoft.graph.conflictBehavior": "rename | fail | replace", "description": "description", "fileSystemInfo": { "@odata.type": "microsoft.graph.fileSystemInfo" }, "name": "'.$file_name.'" }'; $headers = array(); $headers[] = 'Authorization: bearer '.$this->access_token; $headers[] = 'Content-Type: application/json'; $data = $this->_curl( 'https://graph.microsoft.com/v1.0/me/drive/items/'.$this->file_id.'/createUploadSession', $post, false, $headers ); $fragSize = 1024 * 1024; $fileSize = filesize($file_path); $numFragments = ceil($fileSize / $fragSize); $bytesRemaining = $fileSize; $i = 0; $ch = curl_init($data['uploadUrl']); while ($i < $numFragments) { $chunkSize = $numBytes = $fragSize; $start = $i * $fragSize; $end = $i * $fragSize + $chunkSize - 1; $offset = $i * $fragSize; if ($bytesRemaining < $chunkSize) { $chunkSize = $numBytes = $bytesRemaining; $end = $fileSize - 1; } if ($stream = fopen($file_path, 'r')) { $data = stream_get_contents($stream, $chunkSize, $offset); fclose($stream); } $content_range = " bytes " . $start . "-" . $end . "/" . $fileSize; curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $data); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PUT"); curl_setopt($ch, CURLOPT_POST, 1); $headers = array(); $headers[] = 'Authorization: bearer '.$this->access_token; $headers[] = 'Content-Length: '.$numBytes; $headers[] = 'Content-Range: '.$content_range; curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); curl_exec($ch); if (curl_errno($ch)) { echo 'Error:' . curl_error($ch); } $bytesRemaining = $bytesRemaining - $chunkSize; $i++; } curl_close($ch); return $this->downloadURL(); } public function downloadURL() { $post = '{ "type": "view", "scope": "anonymous" }'; $headers = array(); $headers[] = 'Authorization: bearer '.$this->access_token; $headers[] = 'Content-Type: application/json'; $data = $this->_curl( 'https://graph.microsoft.com/v1.0/me/drive/items/'.$this->file_id.'/createLink', $post, false, $headers ); if( isset($data['error']) ) { throw new Exception($data['error']['message']); exit; } return array('url' => $data['link']['webUrl']); } private function _curl( $url, $post, $put = false, $headers = array() ) { sleep(1); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $post); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); if( $put ) { curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT'); } curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); $result = curl_exec($ch); if( curl_errno($ch) ) { throw new Exception(curl_error($ch)); exit; } curl_close($ch); $arr = json_decode($result, true); return $arr; } } widget-mas-calificados.php 0000644 00000010033 15151400310 0011540 0 ustar 00 <?php if( ! defined( 'ABSPATH' ) ) die ( '✋' ); class mas_calificados_Widget extends WP_Widget { public function __construct() { parent::__construct( 'mas_calificados_widget', '[Appyn] '.__( 'Apps más calificadas', 'appyn' ), array('description' => __( 'Muestra las apps más calificadas de tu sitio', 'appyn' ),) ); } public function widget($args, $instance) { extract($args); $title = ''; $instance = array_filter($instance); if( isset($instance['title']) ){ $title = apply_filters('widget_title', $instance['title']); } else { $title = __( 'Apps más calificadas', 'appyn' ); } echo $before_widget; echo $before_title.$title.$after_title; echo '<div class="widget-content">'; global $wpdb, $post; $n = 0; $args = array( 'meta_key' => 'new_rating_users', 'orderby' => 'meta_value_num', 'ignore_sticky_posts' => 1 ); if( ! empty($instance['cantidad']) ) { $args['posts_per_page'] = ( $instance['cantidad'] ) ? $instance['cantidad'] : 5; } if( ! empty($instance['categoria']) ) { $args['cat'] = array($instance['categoria']); } if( appyn_options( 'versiones_mostrar_widgets') == 1 ) { $args['post_parent'] = 0; } if( ! empty($instance['mod_apps_widget']) ) { $args['meta_query'] = array( array( 'key' => 'app_type', 'value' => array(1), 'compare' => 'IN', ) ); } $ms = new WP_Query($args); echo '<ul>'; if( $ms->have_posts() ) : while( $ms->have_posts() ) : $ms->the_post(); get_template_part('template-parts/loop/app-widget'); endwhile; else: echo '<span class="noentry">'.__( 'No hay entradas', 'appyn' ).'</span>'; endif; wp_reset_query(); echo '</ul></div>'; echo $after_widget; } public function update($new_instance, $old_instance) { $instance = array(); $instance['title'] = strip_tags($new_instance['title']); $instance['cantidad'] = strip_tags($new_instance['cantidad']); $instance['categoria'] = $new_instance['categoria']; if(!is_numeric(strip_tags($new_instance['cantidad']))){ $instance['cantidad'] = '0'; } return $instance; } public function form($instance) { $defaults = array( 'title' => __( 'Apps más calificadas' , 'appyn' ), 'cantidad' => 5 ); $instance = wp_parse_args( (array) $instance, $defaults ); ?> <p> <label for="<?php echo $this->get_field_id('title'); ?>"><?php echo __( 'Título', 'appyn' ); ?>:</label> <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo esc_attr($instance["title"]); ?>" /> </p> <p> <label for="<?php echo $this->get_field_id('cantidad'); ?>"><?php echo __( 'De una categoría', 'appyn' ); ?>:</label> <select name="<?php echo $this->get_field_name('categoria'); ?>"> <option value="0"><?php echo __( 'Ninguna', 'appyn' ); ?></option> <?php $categories = get_categories(); foreach($categories as $category) { if( isset($instance['categoria']) ) { if( $instance['categoria'] == $category->term_id ) { ?> <option value="<?php echo $category->term_id; ?>" selected><?php echo $category->name; ?></option> <?php } } else { ?> <option value="<?php echo $category->term_id; ?>"><?php echo $category->name; ?></option> <?php } ?> <?php } ?> </select> </p> <p> <label for="<?php echo $this->get_field_id('cantidad'); ?>"><?php echo __( 'Número de entradas a mostrar', 'appyn' ); ?>:</label> <input id="<?php echo $this->get_field_id('cantidad'); ?>" name="<?php echo $this->get_field_name('cantidad'); ?>" type="text" value="<?php echo esc_attr($instance["cantidad"]); ?>" size="3" maxlength="2" /> </p> <?php } } add_action('widgets_init', function() { register_widget("mas_calificados_Widget"); }); widget-ultimos-posts.php 0000644 00000010051 15151400310 0011363 0 ustar 00 <?php if( ! defined( 'ABSPATH' ) ) die ( '✋' ); class ultimos_posts_Widget extends WP_Widget { public function __construct() { parent::__construct( 'ultimos_posts_widget', '[Appyn] '.__( 'Últimas Aplicaciones', 'appyn' ), array('description' => __( 'Muestra las últimas aplicaciones de tu sitio', 'appyn' ),) ); } public function widget($args, $instance) { extract($args); $title = ''; $instance = array_filter($instance); if( isset($instance['title']) ){ $title = apply_filters('widget_title', $instance['title']); } else { $title = __( 'Últimas Aplicaciones', 'appyn' ); } echo $before_widget; echo $before_title.$title.$after_title; echo '<div class="widget-content">'; global $wpdb, $post; $n = 0; $args = array( 'orderby' => 'post_date', 'ignore_sticky_posts' => 1 ); if( ! empty($instance['cantidad']) ) { $args['posts_per_page'] = ( $instance['cantidad'] ) ? $instance['cantidad'] : 5; } if( ! empty($instance['categoria']) ) { $args['cat'] = array($instance['categoria']); } if( appyn_options( 'versiones_mostrar_widgets') == 1 ) { $args['post_parent'] = 0; } if( ! empty($instance['mod_apps_widget']) ) { $args['meta_query'] = array( array( 'key' => 'app_type', 'value' => array(1), 'compare' => 'IN', ) ); } $query = new WP_Query($args); echo '<ul>'; if( $query->have_posts() ) { while($query->have_posts()): $query->the_post(); get_template_part('template-parts/loop/app-widget'); endwhile; } else { echo '<span class="noentry">'.__( 'No hay entradas', 'appyn' ).'</span>'; } echo '</ul></div>'; wp_reset_query(); echo $after_widget; } public function update($new_instance, $old_instance) { $instance = array(); $instance['title'] = strip_tags($new_instance['title']); $instance['cantidad'] = strip_tags($new_instance['cantidad']); $instance['categoria'] = $new_instance['categoria']; if(!is_numeric(strip_tags($new_instance['cantidad']))){ $instance['cantidad'] = '0'; } return $instance; } public function form($instance) { $defaults = array( 'title' => __( 'Últimas Aplicaciones' , 'appyn' ), 'cantidad' => 5 ); $instance = wp_parse_args( (array) $instance, $defaults ); ?> <p> <label for="<?php echo $this->get_field_id('title'); ?>"><?php echo __( 'Título', 'appyn' ); ?>:</label> <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo esc_attr($instance["title"]); ?>" /> </p> <p> <label for="<?php echo $this->get_field_id('cantidad'); ?>"><?php echo __( 'De una categoría', 'appyn' ); ?>:</label> <select name="<?php echo $this->get_field_name('categoria'); ?>"> <option value="0"><?php echo __( 'Ninguna', 'appyn' ); ?></option> <?php $categories = get_categories(); foreach($categories as $category) { if( isset($instance['categoria']) ) { if( $instance['categoria'] == $category->term_id ) { ?> <option value="<?php echo $category->term_id; ?>" selected><?php echo $category->name; ?></option> <?php } } else { ?> <option value="<?php echo $category->term_id; ?>"><?php echo $category->name; ?></option> <?php } ?> <?php } ?> </select> </p> <p> <label for="<?php echo $this->get_field_id('cantidad'); ?>"><?php echo __( 'Número de entradas a mostrar', 'appyn' ); ?></label> <input id="<?php echo $this->get_field_id('cantidad'); ?>" name="<?php echo $this->get_field_name('cantidad'); ?>" type="text" value="<?php if(esc_attr($instance["cantidad"])) echo esc_attr($instance["cantidad"]); else echo '5'; ?>" size="3" maxlength="2" /> </p> <?php } } add_action('widgets_init', function() { register_widget("ultimos_posts_Widget"); }); class-1fichier.php 0000644 00000032401 15151400310 0010040 0 ustar 00 <?php if( ! defined( 'ABSPATH' ) ) die ( '✋' ); class fichier { /** * @var Client */ private $client; /** * @var */ public $error; /** * fichier constructor. * @param $token */ public function __construct() { require_once TEMPLATEPATH . '/includes/google-api-php-client-master/vendor/autoload.php'; $token = appyn_options( '1fichier_apikey' ); $this->client = new GuzzleHttp\Client([ 'base_uri' => 'https://api.1fichier.com/v1/', 'http_errors' => false, 'headers' => [ 'Accept' => 'application/json', 'Authorization' => 'Bearer ' . $token ] ]); } /** * @param $json * @param $uri * @return bool|mixed */ public function request($json, $uri) { try { $response = $this->client->request('POST', $uri, [ 'json' => $json ]); } catch (GuzzleHttp\Exception\GuzzleException $e) { $this->error = $e; return false; } $output = json_decode($response->getBody()->getContents(), true ); if( $output['status'] == "KO" ) { throw new Exception($output['message']); } sleep(2); return $output; } /** * @param $uri * @return bool|mixed */ public function download($uri) { $json = [ "url" => $uri, "pretty" => 1 ]; return $this->request($json,"download/get_token.cgi"); } /** * @param $folder_id * @return bool|mixed */ public function file_ls($folder_id = 0) { $json = [ "folder_id" => $folder_id, "pretty" => 1 ]; return $this->request($json, "file/ls.cgi"); } /** * @param $url * @return bool|mixed */ public function file_info($url) { $json = [ "url" => $url, "pretty" => 1 ]; return $this->request($json, "file/info.cgi"); } /** * @param $url * @return bool|mixed */ public function av_scan($url) { $json = [ "url" => $url, "pretty" => 1 ]; return $this->request($json, "file/scan.cgi"); } /** * @param $urls * @return bool|mixed */ public function file_rm($urls) { if(is_array($urls)){ foreach($urls as $url){ $files []= array("url" => $url); } }else{ $files []= array("url" => $urls); } if (!empty($files)) { $json = [ "files" => $files ]; }else{ return false; } return $this->request($json, "file/rm.cgi"); } /** * @param $urls * @param $folder_id * @return bool|mixed */ public function file_mv($urls, $folder_id) { if(!is_array($urls)){ $urls = [$urls]; } $json = [ "pretty" => 1, "destination_folder_id" => $folder_id, "urls" => $urls ]; return $this->request($json, "file/mv.cgi"); } /** * @param $urls * @param $folder_id * @return bool|mixed */ public function file_cp($urls, $folder_id) { if(!is_array($urls)){ $urls = [$urls]; } $json = [ "pretty" => 1, "destination_folder_id" => $folder_id, "urls" => $urls ]; return $this->request($json, "file/cp.cgi"); } public function file_rn($url, $filename) { $json = [ "pretty" => 1, "urls" => [$url], "filename" => $filename ]; return $this->request($json, "file/chattr.cgi"); } public function upload_token() { $json = [ "pretty" => 1 ]; return $this->request($json, "upload/get_upload_server.cgi"); } public function upload_file($filepath, $to = 0, $domain = 0) { $server = $this->upload_token(); try { $response = $this->client->request('POST', "https://" . $server["url"] . "/upload.cgi?id=" . $server["id"], [ 'multipart' => [ [ 'name' => "file[]", 'contents' => fopen($filepath, 'r'), 'did' => $to, 'domain' => $domain ] ] ]); } catch (GuzzleHttp\Exception\GuzzleException $e) { $this->error = $e; return false; } $body = $response->getBody()->getContents(); if( preg_match('/Upload finished|Envoi terminé/ms', $body)){ try { $response = $this->client->request('POST', "https://" . $server["url"] . "/end.pl?xid=" . $server["id"], [ 'headers' => [ "JSON" => 1 ] ]); } catch (GuzzleHttp\Exception\GuzzleException $e) { $this->error = $e; return false; } return json_decode($response->getBody()->getContents(), true); } } /** * @param $folder_id * @return bool|mixed */ public function folder_ls($folder_id = 0) { $json = [ "folder_id" => $folder_id, "pretty" => 1 ]; return $this->request($json, "folder/ls.cgi"); } /** * @param $name * @param bool $folder_id * @param bool $sharing_user * @return bool|mixed */ public function mkdir($name, $folder_id = false, $sharing_user = false) { $json = [ "name" => $name, ]; if($folder_id){ $json["folder_id"] = $folder_id; } if($sharing_user){ $json["sharing_user"] = $sharing_user; } return $this->request($json, "folder/mkdir.cgi"); } /** * @param $folder_id * @param int $share * @param bool $pass * @param bool $shares * @return bool|mixed */ public function folder_share($folder_id, $share = 0, $pass = false, $shares = false) { $json = [ "folder_id" => $folder_id, "share" => $share ]; if($pass){ $json["pass"] = $pass; } if($shares){ $json["shares"] = $shares; } return $this->request($json, "folder/share.cgi"); } /** * @param $email * @param int $rw * @param int $hide_links * @param bool $add_array * @return array */ public function folder_share_gen($email, $rw = 0, $hide_links = 0, $add_array = false) { $json = [ "email" => $email, "rw" => $rw, "hide_links" => $hide_links ]; if(is_array($add_array)){ $array[] = $add_array; } $array[] = $json; return $array; } /** * @param $folder_id * @param $destination_folder_id * @param bool $destination_user * @return bool|mixed */ public function folder_mv($folder_id, $destination_folder_id, $destination_user = false) { $json = [ "folder_id" => $folder_id, "destination_folder_id" => $destination_folder_id ]; if($destination_user){ $json["destination_user"] = $destination_user; } return $this->request($json, "folder/mv.cgi"); } /** * @param $folder_id * @return bool|mixed */ public function folder_rm($folder_id) { $json = [ "folder_id" => $folder_id ]; return $this->request($json, "folder/rm.cgi"); } public function ftp_process() { $json = [ "pretty" => 1 ]; return $this->request($json, "ftp/process.cgi"); } public function ftp_user_ls() { $json = [ "pretty" => 1 ]; return $this->request($json, "ftp/users/ls.cgi"); } public function ftp_user_add($username, $password, $folder_id) { $json = [ "user" => $username, "pass" => $password, "folder_id" => $folder_id ]; return $this->request($json, "ftp/users/add.cgi"); } public function ftp_user_rm($username) { $json = [ "user" => $username ]; return $this->request($json, "ftp/users/rm.cgi"); } public function remote_ls() { $json = [ "pretty" => 1 ]; return $this->request($json, "remote/ls.cgi"); } public function remote_info($id) { $json = [ "id" => $id ]; return $this->request($json, "remote/info.cgi"); } public function remote_request($urls, $folder_id, $headers = false) { $json = [ "urls" => $urls, "folder_id" => $folder_id, ]; if($headers){ $json["headers"] = $headers; } return $this->request($json, "remote/request.cgi"); } /** * checksum parser * * checksum ``openssl dgst -whirlpool * > all.checksum`` * checksum_parser("all.checksum") fullpath or __DIR__ / all.checksum * [ * ["filename", "hash"], * ["filename", "hash"], * ... * ] * * @param $filename * @return bool | array */ public function checksum_parser($filename){ if(!file_exists($filename)){ $filename = __DIR__ . "/" . $filename; if(!file_exists($filename)){ return false; } } $body = file_get_contents($filename); $checksums = array_values(array_filter(explode("\n", $body), "strlen")); $parser = []; foreach($checksums as $id => $checksum){ if(preg_match('|whirlpool\(([^)]*)\)= (.*)$|', $checksum, $match)){ $parser[$match[2]] = $match[1]; } } return $parser; } /** * checksum_check * * checksum file path and how to make checksum view checksum_parse doc * find checksum from folder * if find all checksum to return true * $verbose true to show OK or NOT * * When not find checksum return not fond file and checksum * return array format is same as checksum_parser * * * @param $filename * @param $folder_id * @param bool $verbose * @return array|bool */ public function checksum_check($filename, $folder_id, $verbose = false){ $files = $this->file_ls($folder_id)["items"]; if(!$files){ $this->error = "checksum_check: folder_id is notfound or connection error"; return false; } $checksums = $this->checksum_parser($filename); $errors = []; foreach($checksums as $checksum => $name){ $bool = false; foreach($files as $file){ if($file["checksum"] === $checksum){ $bool = true; } } if(!$bool){ $errors[$checksum] = $name; if($verbose){ echo "NOT " . $name . "\n"; } }else{ if($verbose){ echo "OK " . $name . "\n"; } } } if(empty($errors)){ return []; }else{ return $errors; } } /** * @param $checksum_path * @param $folder_id * @return array */ public function checksum_diff($checksum_path, $folder_id){ return array_diff($this->checksum_parser($checksum_path), $this->checksum_check($checksum_path, $folder_id)); } public function duplicate_delete($folder_id, $filename) { foreach($this->file_ls($folder_id)["items"] as $video) { if($video["filename"] == $filename) { $this->file_rm($video["url"]); return; } } } public function Upload( $file, $filename ) { $this->duplicate_delete( 0, $filename ); $u = $this->upload_file( $file ); if( $u ) { return array( 'url' => $u['links'][0]['download'] ); } } } class-list-table-modapps.php 0000644 00000024016 15151400310 0012052 0 ustar 00 <?php if( ! defined( 'ABSPATH' ) ) die ( '✋' ); if ( ! class_exists( 'WP_List_Table' ) ) { require_once( ABSPATH . 'wp-admin/includes/class-wp-list-table.php' ); } class List_Table_ModApps extends WP_List_Table { var $total_posts; var $total_posts_import; var $total_posts_noimport; var $posts_per_page; var $response; var $error = false; var $posts; var $has_title = false; var $list_ids; var $is_search = false; var $status; var $response_body; public function __construct() { parent::__construct( [ 'singular' => 'app_to_import', 'plural' => 'apps_to_import', 'ajax' => false ] ); $s = ( isset($_GET['s']) ) ? $_GET['s'] : ''; if( $s ) { $url = API_URL.'/v2/mod/search/'.urlencode($s); $this->is_search = true; } else { $url = API_URL.'/v2/mod/latestapps'; } $this->posts_per_page = 20; $this->status = ( isset($_GET['status']) ) ? $_GET['status'] : null; $response = function() use ($url) { return wp_remote_post( $url, array( 'method' => 'POST', 'timeout' => 333, 'blocking' => true, 'sslverify' => false, 'headers' => array( 'Referer' => get_site_url(), 'Cache-Control' => 'max-age=0', 'Expect' => '', ), 'body' => array( 'apikey' => appyn_options( 'apikey', true ), 'website' => get_site_url(), ), ) ); }; if( ! $this->is_search ) { if( ! get_transient( 'appyn_results_latest_mod_apps' ) ) { $response = $response(); if ( ! is_wp_error( $response ) ) { set_transient( 'appyn_results_latest_mod_apps', $response, 60 * MINUTE_IN_SECONDS ); set_transient( 'appyn_results_latest_mod_apps_bu', $response, 2 * DAY_IN_SECONDS ); } else { $response = get_transient( 'appyn_results_latest_mod_apps_bu' ); } } else { $rsx = get_transient( 'appyn_results_latest_mod_apps' ); if ( isset($rsx->errors['http_request_failed'][0]) ) { $response = $rsx; } $response = $rsx; } } else { $response = $response(); } global $post; $query = new WP_Query( array( 'posts_per_page' => -1, 'post_parent' => 0, 'suppress_filters' => true, 'cache_results' => false, 'meta_key' => 'mod_app_id' ) ); $this->list_ids = array(); if( $query->have_posts() ) : while( $query->have_posts() ) : $query->the_post(); $mod_app_id = get_post_meta( $post->ID, 'mod_app_id', true ); $this->list_ids[$mod_app_id] = $post->ID; endwhile; endif; if ( is_wp_error( $response ) ) { $response = $response->get_error_message(); } $this->response = $response; $this->response_body = json_decode( $this->response['body'], true ); if( $this->response_body['status'] == 'error' ) { $this->response = $this->response_body['response']; return; } $this->total_posts = $this->response_body['total_results']; if( $this->total_posts == 0 ) { $this->response = false; } if( ! $this->is_search ) { set_transient( 'total_posts_latest', $this->total_posts, 24 * HOUR_IN_SECONDS ); } $this->apps_by_status( $this->response_body['results'] ); } private function clean_result_search( $results ) { $nr = array(); foreach( $results as $res ) { foreach( $res as $re ) { $nr[] = $re; } } return $nr; } public function get_apps_to_import() { if( !isset($this->response_body['results']) ) return; $paged = isset( $_GET['paged'] ) ? $_GET['paged'] : 1; if( $this->is_search ) { $r = array(); $results = $this->clean_result_search( $this->response_body['results'] ); if( $this->status == 'imported' ) { foreach( $results as $res ) { if( array_key_exists( $res['u'], $this->list_ids ) ) { $r[] = $res; } } $ra = array_slice($r, ($paged - 1) * $this->posts_per_page, $this->posts_per_page); if( empty($r) || empty($ra) ) { $this->response = false; } $this->total_posts = count($r); return $ra; } elseif( $this->status == 'no-imported' ) { foreach( $results as $res ) { if( ! array_key_exists( $res['u'], $this->list_ids ) ) { $r[] = $res; } } $ra = array_slice($r, ($paged - 1) * $this->posts_per_page, $this->posts_per_page); if( empty($r) || empty($ra) ) { $this->response = false; } $this->total_posts = count($r); return $ra; } return array_slice($results, ($paged - 1) * $this->posts_per_page, $this->posts_per_page); } else { $r = array(); if( $this->status == 'imported' ) { foreach( $this->response_body['results'] as $res ) { if( array_key_exists( $res['u'], $this->list_ids ) ) { $r[] = $res; } } $ra = array_slice($r, ($paged - 1) * $this->posts_per_page, $this->posts_per_page); if( empty($r) || empty($ra) ) { $this->response = false; } $this->total_posts = count($r); return $ra; } elseif( $this->status == 'no-imported' ) { foreach( $this->response_body['results'] as $res ) { if( ! array_key_exists( $res['u'], $this->list_ids ) ) { $r[] = $res; } } $ra = array_slice($r, ($paged - 1) * $this->posts_per_page, $this->posts_per_page); if( empty($r) || empty($ra) ) { $this->response = false; } $this->total_posts = count($r); return $ra; } return array_slice($this->response_body['results'], ($paged - 1) * $this->posts_per_page, $this->posts_per_page); } } private function apps_by_status( $results ) { if( $this->is_search ) { $results = $this->clean_result_search( $results ); } $a = 0; foreach( $results as $res ) { if( array_key_exists( $res['u'], $this->list_ids ) ) { $a++; } } $this->total_posts_import = $a; $b = 0; foreach( $results as $res ) { if( ! array_key_exists( $res['u'], $this->list_ids ) ) { $b++; } } $this->total_posts_noimport = $b; } function column_cb($item){ return sprintf( '<input type="checkbox" name="%1$s[]" value="%2$s" />', 'apps_to_import', $item['u'] ); } public function no_items() { echo ( $this->response ) ? $this->response : __( 'No hay apps modificadas', 'appyn' ); } public function column_default( $item, $column_name ) { $impt = ''; $chck = ( array_key_exists( $item['u'], $this->list_ids ) ) ? true : false; if( $chck ) { $impt = '<a href="'.get_edit_post_link( $this->list_ids[$item['u']] ).'" target="_blank" title="'.__('View post').'"><i class="fas fa-file-import"></i></a>'; } switch ( $column_name ) { case 'post_title': return '<div><span><img src="'.$item['img'].'" width="50" height="50"></span><span>' .$item['title'].'</span> '.$impt.'</div>'; break; case 'version': return $item[$column_name]; break; case 'import': return '<div><button type="button" class="button app_import" data-u="'.$item['u'].'" '.( ( $chck ) ? 'data-post-id="'.$this->list_ids[$item['u']].'" data-import-type="reimport_mod"' : ' data-import-type="mod"').'>'.( ( $chck ) ? __( 'Re-importar', 'appyn' ) : __( 'Importar', 'appyn' ) ).'</button></div>'; break; default: return ''; } } public function get_columns() { $columns = [ 'cb' => '<input type="checkbox" />', 'post_title' => __( 'App', 'appyn' ).( ( isset($this->response_body['id']) ) ? '<input type="hidden" id="result_id" value="'.$this->response_body['id'].'">' : ''), 'version' => __( 'Versión', 'appyn' ), 'import' => '', ]; return $columns; } public function get_bulk_actions() { return array( 'import' => __( 'Importar', 'appyn' ), ); } public function search_box( $text, $input_id ) { $input_id = $input_id . '-search-input'; ?> <p class="search-box"> <label class="screen-reader-text" for="<?php echo esc_attr( $input_id ); ?>"><?php echo $text; ?>:</label> <input type="search" id="<?php echo esc_attr( $input_id ); ?>" name="s" value="<?php _admin_search_query(); ?>" /> <?php submit_button( $text, '', '', false, array( 'id' => 'search-submit' ) ); ?> </p> <?php } public function prepare_items() { $columns = $this->get_columns(); $hidden = array( 'id' ); $this->_column_headers = array( $columns, $hidden ); $tpl = ( get_transient( 'total_posts_latest' ) ) ? get_transient( 'total_posts_latest' ) : 0; $per_page = $this->get_items_per_page( 'apps_to_import_per_page', $this->posts_per_page ); $total_items = $this->total_posts ? $this->total_posts : 0; $tpi = ( $this->total_posts_import ) ? $this->total_posts_import : 0; $tpni = ( $this->total_posts_noimport ) ? $this->total_posts_noimport : 0; if( $this->status == 'imported' ) { $items_ = $tpi; } elseif( $this->status == 'no-imported' ) { $items_ = $tpni; } else { $items_ = $total_items; } $this->set_pagination_args( [ 'total_items' => $items_, 'per_page' => $per_page, ] ); echo '<ul class="subsubsub">'; if( $this->is_search ) { echo '<li class="all"><a href="'.remove_query_arg( array('status', 's', 'paged') ).'">'.__( 'Últimas apps modificadas', 'appyn' ).' <span class="count">('.$tpl.')</span></a></li> '; } echo '<li class="all"><a href="'.remove_query_arg( 'status' ).'"'.( ( ! $this->status ) ? ' class="current"' : '').'>'.__( 'Todos', 'appyn' ).' <span class="count">('.$total_items.')</span></a></li> <li class="all"><a href="'.remove_query_arg( 'paged', add_query_arg( 'status', 'imported' ) ).'" '.( ( $this->status == 'imported' ) ? ' class="current"' : '').'>'.__( 'Importados', 'appyn' ).' <span class="count">('.$tpi.')</span></a></li> <li class="all"><a href="'.remove_query_arg( 'paged', add_query_arg( 'status', 'no-imported' ) ).'" '.( ( $this->status == 'no-imported' ) ? ' class="current"' : '').'>'.__( 'No importados', 'appyn' ).' <span class="count">('.$tpni.')</span></a></li> </ul>'; $this->items = $this->get_apps_to_import(); } } class-google-drive.php 0000644 00000013307 15151400311 0010736 0 ustar 00 <?php if( ! defined( 'ABSPATH' ) ) die ( '✋' ); class TPX_GoogleDrive { public function getClient() { $a = appyn_options( 'gdrive_client_id', true ); $b = appyn_options( 'gdrive_client_secret', true ); if( !$a && !$b ) return false; require_once TEMPLATEPATH . '/includes/google-api-php-client-master/vendor/autoload.php'; $redirect_uri = add_query_arg( 'appyn_upload', 'gdrive', get_site_url() ); $config = [ 'client_id' => $a, 'client_secret' => $b, 'redirect_uri' => $redirect_uri ]; $client = new Google_Client($config); $client->setScopes(Google_Service_Drive::DRIVE); $client->setPrompt('select_account consent'); $client->setAccessType('offline'); $client->setApprovalPrompt('force'); if (get_option('appyn_gdrive_token')) { $accessToken = json_decode(get_option('appyn_gdrive_token'), true); $client->setAccessToken($accessToken); } if ($client->isAccessTokenExpired()) { if ($client->getRefreshToken()) { $client->fetchAccessTokenWithRefreshToken($client->getRefreshToken()); } $gat = ( $client->getAccessToken() ) ? $client->getAccessToken() : null; if( $gat ) update_option('appyn_gdrive_token', json_encode($client->getAccessToken())); } return $client; } public function createFolder( $folder_name, $parent_folder_id = null ) { $client = $this->getClient(); $folder_list = $this->checkFolderExists( $folder_name ); if( count( $folder_list ) == 0 ){ $service = new Google_Service_Drive( $client ); $folder = new Google_Service_Drive_DriveFile(); $folder->setName( $folder_name ); $folder->setMimeType('application/vnd.google-apps.folder'); if( !empty( $parent_folder_id ) ){ $folder->setParents( [ $parent_folder_id ] ); } $result = $service->files->create( $folder ); $folder_id = null; if( isset( $result['id'] ) && !empty( $result['id'] ) ){ $folder_id = $result['id']; } return $folder_id; } return $folder_list[0]['id']; } private function checkFolderExists( $folder_name ) { $client = $this->getClient(); $service = new Google_Service_Drive($client); $parameters['q'] = "mimeType='application/vnd.google-apps.folder' and name='$folder_name' and trashed=false"; $files = $service->files->listFiles($parameters); $op = []; foreach( $files as $k => $file ){ $op[] = $file; } return $op; } public function insertFileToDrive( $file_path, $file_name, $parent_file_id = null, $contents = '' ) { $client = $this->getClient(); $service = new Google_Service_Drive($client); $file = new Google_Service_Drive_DriveFile(); $file->setName( $file_name ); if( !empty( $parent_file_id ) ){ $file->setParents( [ $parent_file_id ] ); } try { $client->setDefer(true); $request = $service->files->create( $file, array( 'uploadType' => 'resumable', 'fields' => 'id', ) ); $chunkSizeBytes = 1 * 1024 * 1024; $media = new Google_Http_MediaFileUpload( $client, $request, 'application/octet-stream', null, true, $chunkSizeBytes ); $media->setFileSize(filesize($file_path)); $status = false; $handle = fopen($file_path, "rb"); while (!$status && !feof($handle)) { $chunk = $this->readFileChunk($handle, $chunkSizeBytes); $status = $media->nextChunk($chunk); } $result = false; if ($status != false) { $result = $status; } fclose($handle); $client->setDefer(false); } catch (Exception $e) { return array('error' => json_decode($e->getMessage(), true)['error']['message']); } if( isset( $result['name'] ) && !empty( $result['name'] ) ){ $newPermission = new Google_Service_Drive_Permission(); $newPermission->setType('anyone'); $newPermission->setRole('reader'); try { $service->permissions->create($result['id'], $newPermission); } catch (Exception $e) { return array('error' => json_decode($e->getMessage(), true)['error']['message']); } } $link_download = 'https://drive.google.com/uc?export=download&id='.$result['id']; return array('url' => $link_download); } private function readFileChunk($handle, $chunkSize) { $byteCount = 0; $gChunk = ""; while( !feof($handle) ) { $chunk = fread($handle, 1 * 1024 * 1024); $byteCount += strlen($chunk); $gChunk .= $chunk; if( $byteCount >= $chunkSize ) { return $gChunk; } } return $gChunk; } } class-list-table-latestapps.php 0000644 00000022014 15151400311 0012564 0 ustar 00 <?php if( ! defined( 'ABSPATH' ) ) die ( '✋' ); if ( ! class_exists( 'WP_List_Table' ) ) { require_once( ABSPATH . 'wp-admin/includes/class-wp-list-table.php' ); } class List_Table_LatestApps extends WP_List_Table { var $total_posts; var $total_posts_import; var $total_posts_noimport; var $posts_per_page; var $response; var $error = false; var $posts; var $has_title = false; var $list_ids; var $is_search = false; var $status; var $response_body; public function __construct() { parent::__construct( [ 'singular' => 'gplay_app_to_import', 'plural' => 'gplay_apps_to_import', 'ajax' => false ] ); $url = API_URL.'/v2/gplay/latestapps'; $this->posts_per_page = 50; $this->status = ( isset($_GET['status']) ) ? $_GET['status'] : null; $response = function() use ($url) { return wp_remote_post( $url, array( 'method' => 'POST', 'timeout' => 333, 'blocking' => true, 'sslverify' => false, 'headers' => array( 'Referer' => get_site_url(), 'Cache-Control' => 'max-age=0', 'Expect' => '', ), 'body' => array( 'apikey' => appyn_options( 'apikey', true ), 'website' => get_site_url(), ), ) ); }; if( ! get_transient( 'appyn_results_latest_gplay_apps' ) ) { $response = $response(); if ( ! is_wp_error( $response ) ) { set_transient( 'appyn_results_latest_gplay_apps', $response, 60 * MINUTE_IN_SECONDS ); set_transient( 'appyn_results_latest_gplay_apps_bu', $response, 2 * DAY_IN_SECONDS ); } else { $response = get_transient( 'appyn_results_latest_gplay_apps_bu' ); } } else { $rsx = get_transient( 'appyn_results_latest_gplay_apps' ); if ( isset($rsx->errors['http_request_failed'][0]) ) { $response = $rsx; } $response = $rsx; } global $post; $query = new WP_Query( array( 'posts_per_page' => -1, 'post_parent' => 0, 'suppress_filters' => true, 'cache_results' => false, 'meta_key' => 'px_app_id' ) ); $this->list_ids = array(); if( $query->have_posts() ) : while( $query->have_posts() ) : $query->the_post(); $px_app_id = get_post_meta( $post->ID, 'px_app_id', true ); $this->list_ids[$px_app_id] = $post->ID; endwhile; endif; if ( is_wp_error( $response ) ) { $response = $response->get_error_message(); } $this->response = $response; $this->response_body = json_decode( $this->response['body'], true ); if( $this->response_body['status'] == 'error' ) { $this->response = $this->response_body['response']; return; } $this->total_posts = $this->response_body['total_results']; if( $this->total_posts == 0 ) { $this->response = false; } set_transient( 'total_posts_latest', $this->total_posts, 24 * HOUR_IN_SECONDS ); $this->apps_by_status( $this->response_body['results'] ); } public function get_gplay_apps_to_import() { if( !isset($this->response_body['results']) ) return; $paged = isset( $_GET['paged'] ) ? $_GET['paged'] : 1; $r = array(); if( $this->status == 'imported' ) { foreach( $this->response_body['results'] as $res ) { if( array_key_exists( $res['app_id'], $this->list_ids ) ) { $r[] = $res; } } $ra = array_slice($r, ($paged - 1) * $this->posts_per_page, $this->posts_per_page); if( empty($r) || empty($ra) ) { $this->response = false; } $this->total_posts = count($r); return $ra; } elseif( $this->status == 'no-imported' ) { foreach( $this->response_body['results'] as $res ) { if( ! array_key_exists( $res['app_id'], $this->list_ids ) ) { $r[] = $res; } } $ra = array_slice($r, ($paged - 1) * $this->posts_per_page, $this->posts_per_page); if( empty($r) || empty($ra) ) { $this->response = false; } $this->total_posts = count($r); return $ra; } return array_slice($this->response_body['results'], ($paged - 1) * $this->posts_per_page, $this->posts_per_page); } private function apps_by_status( $results ) { $a = 0; foreach( $results as $res ) { if( array_key_exists( $res['app_id'], $this->list_ids ) ) { $a++; } } $this->total_posts_import = $a; $b = 0; foreach( $results as $res ) { if( ! array_key_exists( $res['app_id'], $this->list_ids ) ) { $b++; } } $this->total_posts_noimport = $b; } function column_cb($item){ return sprintf( '<input type="checkbox" name="%1$s[]" value="%2$s" />', 'apps_to_import', $item['app_id'] ); } public function no_items() { echo ( $this->response ) ? $this->response : __( 'No hay apps', 'appyn' ); } public function column_default( $item, $column_name ) { $impt = ''; $chck = ( array_key_exists( $item['app_id'], $this->list_ids ) ) ? true : false; if( $chck ) { $impt = '<a href="'.get_edit_post_link( $this->list_ids[$item['app_id']] ).'" target="_blank" title="'.__('View post').'"><i class="fas fa-file-import"></i></a>'; } switch ( $column_name ) { case 'post_title': return '<div><span><img src="'.$item['img'].'" width="50" height="50"></span><span>' .$item['title'].'</span> '.$impt.'<a href="https://play.google.com/store/apps/details?id='.$item['app_id'].'" target="_blank" title="'. __( 'Ver en Google Play', 'appyn' ) .'"><img alt="" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA8AAAAQCAMAAAD+iNU2AAAAyVBMVEUAAAAAzf8A/i//2AAA/2L/Plj/MjMA4P8Ayf8AxP8A/yv/MTAA9EwA0v8A+ScA0v/+Q03/My3/1QD/0AD/0wD/3AAA/wD/CgMA/yn/MjMA/y7/MDAA/zf/JTH/1gAA/wD/CAP/0wAA/y7/MTEA/y0Azv8Ay/8A+EoAxf8A/wD/CwP/1gAA5/8A5f8A2v//Pkn/OkP/0QAAwf8A1/0A1fsA/yoA/0H/DTz/KTj/NzP/MzP/AA7/9wD/6QDx6QD02QD/ygD/xAD/swCt0I1nAAAAJXRSTlMA8f0t/v708fHx7OLe29rY1s7EurWtrKGShXZoWEpAKiMdFxAJTZezOAAAAItJREFUCNdNzlcWgyAQBdBJTO+990RMIIKY3qP7X5QoeGD+7jvToFlbglll5Aw2hjN75BxGO207DrIT7SS4VGapVXBtLFLLkR/vWMq2T3PfPyGkK42Ofj58c8L7wjHP3usefHpr0S+JH7e2Jfch9+ThZ3Wu7gkyXJiCqpJLGR7r/4uUDbeaUG+tDEEEzLgTqZH0pKcAAAAASUVORK5CYII=" alt="Google Play" style="height:10px;"></a></div>'; break; case 'version': return $item[$column_name]; break; case 'import': return '<div><button type="button" class="button app_import" data-uid="'.uniqid(true).'" data-app-id="'.$item['app_id'].'" '.( ( $chck ) ? 'data-post-id="'.$this->list_ids[$item['app_id']].'" data-import-type="reimport"' : '').'>'.( ( $chck ) ? __( 'Re-importar', 'appyn' ) : __( 'Importar', 'appyn' ) ).'</button></div>'; break; default: return ''; } } public function get_columns() { $columns = [ 'cb' => '<input type="checkbox" />', 'post_title' => __( 'App', 'appyn' ).( ( isset($this->response_body['id']) ) ? '<input type="hidden" id="result_id" value="'.$this->response_body['id'].'">' : ''), 'version' => __( 'Versión', 'appyn' ), 'import' => '', ]; return $columns; } public function get_bulk_actions() { return array( 'import' => __( 'Importar', 'appyn' ), ); } public function search_box( $text, $input_id ) { $input_id = $input_id . '-search-input'; ?> <p class="search-box"> <label class="screen-reader-text" for="<?php echo esc_attr( $input_id ); ?>"><?php echo $text; ?>:</label> <input type="search" id="<?php echo esc_attr( $input_id ); ?>" name="s" value="<?php _admin_search_query(); ?>" /> <?php submit_button( $text, '', '', false, array( 'id' => 'search-submit' ) ); ?> </p> <?php } public function prepare_items() { $columns = $this->get_columns(); $hidden = array( 'id' ); $this->_column_headers = array( $columns, $hidden ); $per_page = $this->get_items_per_page( 'apps_to_import_per_page', $this->posts_per_page ); $total_items = $this->total_posts ? $this->total_posts : 0; $tpi = ( $this->total_posts_import ) ? $this->total_posts_import : 0; $tpni = ( $this->total_posts_noimport ) ? $this->total_posts_noimport : 0; if( $this->status == 'imported' ) { $items_ = $tpi; } elseif( $this->status == 'no-imported' ) { $items_ = $tpni; } else { $items_ = $total_items; } $this->set_pagination_args( [ 'total_items' => $items_, 'per_page' => $per_page, ] ); echo '<ul class="subsubsub">'; echo '<li class="all"><a href="'.remove_query_arg( array('status', 'paged') ).'"'.( ( ! $this->status ) ? ' class="current"' : '').'>'.__( 'Todos', 'appyn' ).' <span class="count">('.$total_items.')</span></a></li> <li class="all"><a href="'.remove_query_arg( 'paged', add_query_arg( 'status', 'imported' ) ).'" '.( ( $this->status == 'imported' ) ? ' class="current"' : '').'>'.__( 'Importados', 'appyn' ).' <span class="count">('.$tpi.')</span></a></li> <li class="all"><a href="'.remove_query_arg( 'paged', add_query_arg( 'status', 'no-imported' ) ).'" '.( ( $this->status == 'no-imported' ) ? ' class="current"' : '').'>'.__( 'No importados', 'appyn' ).' <span class="count">('.$tpni.')</span></a></li> </ul>'; $this->items = $this->get_gplay_apps_to_import(); } } widget-mas-vistos.php 0000644 00000007751 15151400311 0010644 0 ustar 00 <?php if( ! defined( 'ABSPATH' ) ) die ( '✋' ); class mas_vistos_Widget extends WP_Widget { public function __construct() { parent::__construct( 'mas_vistos_widget', '[Appyn] '.__( 'Apps más vistas', 'appyn' ), array('description' => __( 'Muestra las apps más vistas de tu sitio', 'appyn' ),) ); } public function widget($args, $instance) { extract($args); $title = ''; $instance = array_filter($instance); if( isset($instance['title']) ){ $title = apply_filters('widget_title', $instance['title']); } else { $title = __( 'Apps más vistas', 'appyn' ); } echo $before_widget; echo $before_title.$title.$after_title; echo '<div class="widget-content">'; global $wpdb, $post; $args = array( 'meta_key' => 'px_views', 'orderby' => 'meta_value_num', 'ignore_sticky_posts' => 1 ); if( ! empty($instance['cantidad']) ) { $args['posts_per_page'] = ( $instance['cantidad'] ) ? $instance['cantidad'] : 5; } if( ! empty($instance['categoria']) ) { $args['cat'] = array($instance['categoria']); } if( appyn_options( 'versiones_mostrar_widgets') == 1 ) { $args['post_parent'] = 0; } if( ! empty($instance['mod_apps_widget']) ) { $args['meta_query'] = array( array( 'key' => 'app_type', 'value' => array(1), 'compare' => 'IN', ) ); } $mv = new WP_Query($args); echo '<ul>'; if( $mv->have_posts() ) : while( $mv->have_posts() ) : $mv->the_post(); get_template_part( 'template-parts/loop/app-widget' ); endwhile; else : echo '<span class="noentry">'.__( 'No hay entradas', 'appyn' ).'</span>'; endif; wp_reset_query(); echo '</ul></div>'; echo $after_widget; } public function update($new_instance, $old_instance) { $instance = array(); $instance['title'] = strip_tags($new_instance['title']); $instance['cantidad'] = strip_tags($new_instance['cantidad']); $instance['categoria'] = $new_instance['categoria']; if(!is_numeric(strip_tags($new_instance['cantidad']))){ $instance['cantidad'] = '0'; } return $instance; } public function form($instance) { $defaults = array( 'title' => __( 'Apps más vistas' , 'appyn' ), 'cantidad' => 5 ); $instance = wp_parse_args( (array) $instance, $defaults ); ?> <p> <label for="<?php echo $this->get_field_id('title'); ?>"><?php echo __( 'Título', 'appyn' ); ?>:</label> <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo esc_attr($instance["title"]); ?>" /> </p> <p> <label for="<?php echo $this->get_field_id('cantidad'); ?>"><?php echo __( 'De una categoría', 'appyn' ); ?>:</label> <select name="<?php echo $this->get_field_name('categoria'); ?>"> <option value="0"><?php echo __( 'Ninguna', 'appyn' ); ?></option> <?php $categories = get_categories(); foreach($categories as $category) { if( isset($instance['categoria']) ) { if( $instance['categoria'] == $category->term_id ) { ?> <option value="<?php echo $category->term_id; ?>" selected><?php echo $category->name; ?></option> <?php } } else { ?> <option value="<?php echo $category->term_id; ?>"><?php echo $category->name; ?></option> <?php } ?> <?php } ?> </select> </p> <p> <label for="<?php echo $this->get_field_id('cantidad'); ?>"><?php echo __( 'Número de entradas a mostrar', 'appyn' ); ?>:</label> <input id="<?php echo $this->get_field_id('cantidad'); ?>" name="<?php echo $this->get_field_name('cantidad'); ?>" type="text" value="<?php echo esc_attr($instance["cantidad"]); ?>" size="3" maxlength="2" /> </p> <?php } } add_action('widgets_init', function() { register_widget("mas_vistos_Widget"); }); widget-youtube.php 0000644 00000004104 15151400311 0010220 0 ustar 00 <?php if( ! defined( 'ABSPATH' ) ) die ( '✋' ); class YouTube_Widget extends WP_Widget { public function __construct() { parent::__construct( 'video_widget', '[Appyn] YouTube', array('description' => __( 'Muestra cualquier video de YouTube colocando solo el ID', 'appyn' ),) ); } public function widget($args, $instance) { extract($args); $title = ''; if( isset($instance['title']) ){ $title = apply_filters('widget_title', $instance['title']); } else { $title = 'YouTube'; } echo $before_widget; echo $before_title.$title.$after_title; $youtubeid = $instance['youtubeid']; if($youtubeid){ echo '<div class="video_container"><iframe src="https://www.youtube.com/embed/'.$youtubeid.'?feature=oembed" width="300" height="210" allowfullscreen style="overflow:hidden; border:none"></iframe></div>'; } echo $after_widget; } public function update($new_instance, $old_instance) { $instance = array(); $instance['title'] = strip_tags($new_instance['title']); $instance['youtubeid'] = strip_tags($new_instance['youtubeid']); return $instance; } public function form($instance) { $defaults = array( 'title' => __( 'Youtube' , 'appyn' ), 'youtubeid' => '' ); $instance = wp_parse_args( (array) $instance, $defaults ); ?> <p> <label for="<?php echo $this->get_field_id('title'); ?>"><?php echo __( 'Título', 'appyn' ); ?>:</label> <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo esc_attr($instance["title"]); ?>" /> </p> <p> <label for="<?php echo $this->get_field_id('youtubeid'); ?>">ID:</label> <input class="widefat" id="<?php echo $this->get_field_id('youtubeid'); ?>" name="<?php echo $this->get_field_name('youtubeid'); ?>" type="text" value="<?php echo esc_attr($instance["youtubeid"]); ?>" /> </p> <?php } } add_action('widgets_init', function() { register_widget("YouTube_Widget"); }); ajax.php 0000644 00000035610 15151400311 0006174 0 ustar 00 <?php if( ! defined( 'ABSPATH' ) ) die ( '✋' ); add_action( 'wp_ajax_ajax_searchbox', 'ajax_searchbox' ); add_action( 'wp_ajax_nopriv_ajax_searchbox', 'ajax_searchbox' ); function ajax_searchbox() { global $wpdb, $post; $searchtext = trim($_POST['searchtext']); $return = ''; $args = array( 'post_type' => array('post', 'blog'), 'wpse18703_title' => $searchtext, 'posts_per_page' => -1, 'post_status' => 'publish' ); if( get_option( 'appyn_versiones_mostrar_buscador') == 1 ) { $args['post_parent'] = 0; } $query = new WP_Query( $args ); if( $query->have_posts() ): while( $query->have_posts() ): $query->the_post(); $datos_informacion = get_post_meta($post->ID, 'datos_informacion', true); $return .= '<li><a href="'.get_the_permalink().'" style="display:flex">'; $return .= px_post_thumbnail( 'miniatura', $post ); $return .= '<div><div>'.get_the_title().'</div>'; if( get_post_type() == 'blog' ) { $return .= '<span>Blog</span>'; } if( !empty($datos_informacion['version']) ) { $return .= px_post_mod().'<span>'; if( !empty($datos_informacion['version']) ) { $return .= __( 'Versión', 'appyn' ).': '.$datos_informacion['version']; } $dev_terms = wp_get_post_terms( $post->ID, 'dev', array('fields' => 'all')); if( !empty($dev_terms) ) { $return .= '<br>'.__( 'Desarrollador', 'appyn' ).': '.$dev_terms[0]->name; } $return .= '</span>'; } $return .= '</div></a></li>'; endwhile; endif; echo json_encode($return); die(); } add_action( 'wp_ajax_post_rating', 'post_rating' ); add_action( 'wp_ajax_nopriv_post_rating', 'post_rating' ); function post_rating() { global $wpdb; $post_id = $_POST['post_id']; $rating_count = round($_POST['rating_count']); if(user_no_voted()){ $a = (get_post_meta( $post_id, 'new_rating_count', true ) ? get_post_meta( $post_id, 'new_rating_count', true ) : 0) + $rating_count; $b = (get_post_meta( $post_id, 'new_rating_users', true ) ? get_post_meta( $post_id, 'new_rating_users', true ) : 0) + 1; update_post_meta( $post_id, 'new_rating_users', $b ); update_post_meta( $post_id, 'new_rating_count', $a ); update_post_meta( $post_id, 'new_rating_average', number_format(($a / $b), 1, ".", "") ); if( !isset($_COOKIE['nw_rating']) ) { setcookie("nw_rating", $post_id, time()+(24*365), "/"); } else { $nr = explode(",",$_COOKIE['nw_rating']); $nr[] = $post_id; setcookie("nw_rating", implode(",", $nr), time()+(24*365), "/"); } } if( function_exists('w3tc_flush_post') ) { w3tc_flush_post( $post_id ); } if( function_exists( 'wp_cache_post_change' ) ) { wp_cache_post_change( $post_id ); } if( function_exists( 'wpfc_clear_post_cache_by_id' ) ) { wpfc_clear_post_cache_by_id( $post_id ); } if( defined('LSCWP_V') ) { do_action( 'litespeed_purge_post', $post_id ); } if( function_exists( 'rocket_clean_post' ) ) { rocket_clean_post( $post_id ); } $ar = count_rating($post_id); $ar['users'] = number_format($ar['users'], 0, ",", ","); echo json_encode($ar); die(); } add_action( 'wp_ajax_boxes_add', 'ajax_boxes_add' ); function ajax_boxes_add(){ $content = ( isset($_POST['content']) ) ? $_POST['content'] : ''; $box_key = ( isset($_POST['keycount']) ) ? $_POST['keycount'] : 0; echo '<div class="boxes-a"> <p><input type="text" id="custom_boxes-title-'.$box_key.'" class="widefat" name="custom_boxes['.$box_key.'][title]" value="" placeholder="'.__( 'Título para la caja', 'appyn' ).'"></p> <p>'; ?> <?php wp_editor($content, 'custom_boxes-'.$box_key, array('textarea_name' => 'custom_boxes['.$box_key.'][content]', 'textarea_rows' => 5,'quicktags' => array('buttons' => 'strong,em,link,block,del,ins,img,ul,ol,li,code,close')) ); ?> <?php echo '</p> <p><a href="javascript:void(0)" class="delete-boxes button">'.__( 'Borrar caja', 'appyn' ).'</a></p> </div>'; die(); } add_action( 'wp_ajax_permanent_boxes_add', 'ajax_permanent_boxes_add' ); function ajax_permanent_boxes_add(){ $content = ( isset($_POST['content']) ) ? $_POST['content'] : ''; $box_key = ( isset($_POST['keycount']) ) ? $_POST['keycount'] : 0; echo '<div class="boxes-a"> <h4>'. sprintf( __( 'Caja permanente %s', 'appyn' ), '#'.($box_key+1) ) .'</h4> <p><input type="text" id="permanent_custom_boxes-title-'.$box_key.'" class="widefat" name="permanent_custom_boxes['.$box_key.'][title]" value="" placeholder="'.__( 'Título para la caja', 'appyn' ).'"></p> <p>'; ?> <?php wp_editor($content, 'permanent_custom_boxes-'.$box_key, array('textarea_name' => 'permanent_custom_boxes['.$box_key.'][content]', 'textarea_rows' => 5,'quicktags' => array('buttons' => 'strong,em,link,block,del,ins,img,ul,ol,li,code,close')) ); ?> <?php echo '</p> <p><a href="javascript:void(0)" class="delete-boxes button">'.__( 'Borrar caja', 'appyn' ).'</a></p> </div>'; die(); } add_action( 'wp_ajax_app_report', 'px_app_report' ); add_action( 'wp_ajax_nopriv_app_report', 'px_app_report' ); function px_app_report() { parse_str( $_POST['serialized'], $output ); $continue = false; $recaptcha_site = get_option( 'appyn_recaptcha_site' ); $recaptcha_secret = get_option( 'appyn_recaptcha_secret' ); if( $recaptcha_site && $recaptcha_secret ) { $secret = $recaptcha_secret; $token = $output['token']; $ch = curl_init("https://www.google.com/recaptcha/api/siteverify?secret=".$secret."&response=".$token); curl_setopt($ch, CURLOPT_FRESH_CONNECT, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $response = curl_exec($ch); curl_close($ch); $response = json_decode($response, true); if( $response['success'] === true && $response['action'] == $output['action'] ) { $continue = true; } } else { $continue = true; } $info_new = array( 'option' => $output['report-opt'], 'details' => $output['report-details'], 'email' => $output['report-email'], ); if( $continue ) { $url = wp_get_referer(); $post_id = url_to_postid( $url ); $info = array(); $info_db = get_post_meta( $post_id, 'px_app_report', true ); if( $info_db ) { $info = json_decode( $info_db, true ); } $info[] = $info_new; update_post_meta( $post_id, 'px_app_report', wp_slash(json_encode($info, JSON_UNESCAPED_UNICODE)) ); $appyn_send_report_to_admin = appyn_options( 'send_report_to_admin' ); $ropt = px_reports_opt(); if( $appyn_send_report_to_admin ) { $admin_email = get_option( 'admin_email' ); $subject = __( 'Post reportado', 'appyn' ).' - ' . get_bloginfo( 'name' ); $message = '<p>'.__( 'Hola, tienes un post reportado', 'appyn' ). ':</p>'; $message .= '<p><strong>'.__( 'Post', 'appyn' ).'</strong>: <a href="'.get_permalink( $post_id ).'">'.get_permalink( $post_id ).'</a></p>'; $message .= '<p><strong>'.__( 'Asunto', 'appyn' ).'</strong>: '.$ropt[($info_new['option']-1)].'</p>'; if( $info_new['details'] ) { $message .= '<p><strong>'.__( 'Detalles', 'appyn' ).'</strong>: '.wpautop( wp_strip_all_tags( $info_new['details'] ) ).'</p>'; } $appyn_request_email = appyn_options( 'request_email' ); if( $appyn_request_email ) { $message .= '<p><strong>'.__( 'Email', 'appyn' ).'</strong>: '.$info_new['email'].'</p>'; } $headers = array('Content-Type: text/html; charset=UTF-8'); wp_mail($admin_email, $subject, $message, $headers); } echo 1; } else { echo 0; } die(); } add_action( 'wp_ajax_action_upload_apk', 'y_action_upload_apk' ); function y_action_upload_apk() { if( !isset($_POST['nonce']) ) exit; $nonce = sanitize_text_field( $_POST['nonce'] ); if ( ! wp_verify_nonce( $nonce, 'importgp_nonce' ) ) die ( '✋'); $post_id = $_POST['post_id']; $idps = $_POST['idps']; $apk = $_POST['apk']; $update = ( isset($_POST['date']) ) ? $_POST['date'] : false; $size_offset= $_POST['size_offset']; $size_init = $_POST['size_init']; $part = $_POST['part']; $total_parts= $_POST['total_parts']; $uid = $_POST['uid']; $has_size = ( isset($_POST['has_size']) ) ? filter_var($_POST['has_size'], FILTER_VALIDATE_BOOLEAN) : false; $total_size = $_POST['total_size']; $range = array($size_init, $size_offset); try { $uploadAPK = new UploadAPK($post_id, $idps, $apk, $update, $range, $total_parts, $part, $has_size, $uid, $total_size); $upload = $uploadAPK->uploadFile(); } catch (Exception $e) { echo json_encode(array( 'error' => $e->getMessage() )); die; } $uploadAPK->deleteFile(); if( isset($upload['error']) ) { $info = array( 'error' => $upload['error'] ); } else { $info = array('response' => '<i class="fa fa-check"></i> '.__( 'Archivo subido y asignado al post.', 'appyn' )); } echo json_encode($info); die; } add_action( 'wp_ajax_action_get_filesize', 'y_action_get_filesize' ); add_action( 'wp_ajax_nopriv_action_get_filesize', 'y_action_get_filesize' ); function y_action_get_filesize() { $uid = $_POST['uid']; $file = get_option( 'file_progress_'.$uid, null ); $output = __( 'En proceso...', 'appyn' ); if( isset($file['files']) ) { $size_total = (int) $file['totalsize']; if( $size_total ) { $actual_size = 0; foreach( $file['files'] as $file ) { $actual_size += file_exists($file['name']) ? (int) filesize($file['name']) : null; } if( $actual_size ) $output = number_format( (($actual_size * 100) / $size_total ), 2, '.', '' ).'%'; } echo $output; } else { if( !isset($file['name']) ) return; if( isset( $file['filesize'] ) ) { $size = (int) $file['filesize']; $actual_size = file_exists($file['name']) ? (int) filesize($file['name']) : null; if( $actual_size ) $output = number_format( (($actual_size * 100) / $size ), 2, '.', '' ).'%'; } else { $output = file_exists($file['name']) ? (int) filesize($file['name']) : null; if( $output > 0 ) { $output = px_btoc($output); } else { $output = __( 'En proceso...', 'appyn' ); } } echo $output; } die; } add_action( 'wp_ajax_action_eps', 'eps_function' ); add_action( 'wp_ajax_nopriv_action_eps', 'eps_function' ); function eps_function() { global $wpdb; $type = $_POST['type']; $nonce = sanitize_text_field( $_POST['nonce'] ); if ( ! wp_verify_nonce( $nonce, 'importgp_nonce' ) ) die ( '✋'); $eps = new EPS(); if( $type == "reimport" ) { $post_id = $_POST['post_id']; echo $eps->reimportPost( $post_id ); } elseif( $type == "update" ) { $post_id = $_POST['post_id']; echo $eps->updatePost( $post_id ); } elseif( $type == "create" ) { if( isset($_POST['app_id']) ) { $lang = appyn_options( 'edcgp_lang', get_locale() ); $url_app = 'https://play.google.com/store/apps/details?id='.$_POST['app_id'].'&hl='.$lang.'&gl=LA'; } else { $url_app = $_POST['url_app']; $pattern = '/hl=([^&]+)/'; if( ! preg_match($pattern, $url_app, $matches) ) { $lang = appyn_options( 'edcgp_lang', get_locale() ); $url_app .= '&hl='.$lang.'&gl=LA'; } } echo $eps->createPost( $url_app ); } elseif( $type == "mod" ) { if( isset($_POST['u'], $_POST['id']) ) { echo $eps->createMod( $_POST['id'], $_POST['u'] ); } } elseif( $type == "reimport_mod" ) { $post_id = $_POST['post_id']; if( isset($_POST['u'], $_POST['id']) ) { echo $eps->createMod( $_POST['id'], $_POST['u'], $post_id ); } } exit; } add_action( 'wp_ajax_px_recaptcha_download_links', 'px_recaptcha_download_links' ); add_action( 'wp_ajax_nopriv_px_recaptcha_download_links', 'px_recaptcha_download_links' ); function px_recaptcha_download_links() { if( !isset($_POST['rdl_nonce']) ) die ( '✋' ); $nonce = sanitize_text_field( $_POST['rdl_nonce'] ); if ( ! wp_verify_nonce( $nonce, 'rdl_nonce' ) ) die ( '✋' ); $get_opt = $_POST['get_opt']; $get_dl = $_POST['get_dl']; $post_id = $_POST['post_id']; $sev2 = appyn_options( 'recaptcha_v2_secret' ); $siv2 = appyn_options( 'recaptcha_v2_site' ); $continue = false; if( $sev2 && $siv2 ) { $token = $_POST['token']; $ch = curl_init("https://www.google.com/recaptcha/api/siteverify?secret=".$sev2."&response=".$token); curl_setopt($ch, CURLOPT_FRESH_CONNECT, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); $response = curl_exec($ch); curl_close($ch); $response = json_decode($response, true); if( $response['success'] === true ) { $continue = true; } else { die( $response['error-codes'][0] ); } } else { $continue = true; } if( $continue ) { func_list_download_links($post_id, $get_opt, $get_dl); } exit; } add_action( 'wp_ajax_search_posts', 'search_posts' ); function search_posts() { global $post; $s = $_POST['s']; $query = new WP_Query(array( 'post_status' => 'publish', 'post_type' => 'post', 's' => $s, 'post_parent' => 0, 'posts_per_page' => 50)); if( $query->have_posts() ) : echo '<ul>'; while( $query->have_posts() ) : $query->the_post(); echo '<li data-post-id="'.$post->ID.'">'.$post->post_title.'</li>'; endwhile; echo '</ul>'; else : echo '<div style="padding:5px 10px">'.__( 'No hay entradas', 'appyn' ).'</div>'; endif; exit; } add_action( 'wp_ajax_search_mod_apps', 'search_mod_apps' ); function search_mod_apps() { $s = $_POST['s']; $url = API_URL.'/v2/mod/search/'.urlencode($s); $response = wp_remote_post( $url, array( 'method' => 'POST', 'timeout' => 30, 'blocking' => true, 'sslverify' => false, 'headers' => array( 'Referer' => get_site_url(), 'Cache-Control' => 'max-age=0', 'Expect' => '', ), 'body' => array( 'apikey' => appyn_options( 'apikey', true ), 'website' => get_site_url(), ), ) ); if ( ! is_wp_error( $response ) ) { global $post; $query = new WP_Query( array( 'posts_per_page' => -1, 'post_parent' => 0, 'suppress_filters' => true, 'cache_results' => false, 'meta_key' => 'mod_app_id' ) ); $list_ids = array(); if( $query->have_posts() ) : while( $query->have_posts() ) : $query->the_post(); $mod_app_id = get_post_meta( $post->ID, 'mod_app_id', true ); $list_ids[$mod_app_id] = $post->ID; endwhile; endif; $response_body = json_decode( $response['body'], true ); foreach( $response_body['results'] as $keyr => $rb ) { foreach( $rb as $key => $r ) { if( array_key_exists( $r['u'], $list_ids ) ) { $r['impt'] = '<a href="'.get_edit_post_link( $list_ids[$r['u']] ).'" target="_blank" title="'.__('View post').'"><i class="fas fa-file-import"></i></a>'; } $response_body['results'][$keyr][$key] = $r; } } echo json_encode($response_body); } else { $error_string = $response->get_error_message(); echo $error_string; } exit; } widget-mas-vistos-blog.php 0000644 00000005303 15151400311 0011554 0 ustar 00 <?php if( ! defined( 'ABSPATH' ) ) die ( '✋' ); class mas_vistos_blog_Widget extends WP_Widget { public function __construct() { parent::__construct( 'mas_vistos_blog_widget', '[Appyn] '.__( 'Posts más vistos', 'appyn' ).' - BLOG', array('description' => __( 'Muestra los posts más vistos de tu sitio', 'appyn' ),) ); } public function widget($args, $instance) { extract($args); $title = ''; if( isset($instance['title']) ){ $title = apply_filters('widget_title', $instance['title']); } else { $title = __( 'Posts más vistos', 'appyn' ); } echo $before_widget; echo $before_title.$title.$after_title; echo '<div class="widget-content">'; global $wpdb, $post; $args = array( 'post_type' => 'blog', 'meta_key' => 'px_views', 'orderby' => 'meta_value_num', 'ignore_sticky_posts' => 1 ); if( ! empty($instance['cantidad']) ) { $args['posts_per_page'] = ( $instance['cantidad'] ) ? $instance['cantidad'] : 5; } $mv = new WP_Query($args); echo '<ul>'; if( $mv->have_posts() ) : while( $mv->have_posts() ) : $mv->the_post(); get_template_part('template-parts/loop/blog-widget'); endwhile; else : echo '<span class="noentry">'.__( 'No hay entradas', 'appyn' ).'</span>'; endif; wp_reset_query(); echo '</ul></div>'; echo $after_widget; } public function update($new_instance, $old_instance) { $instance = array(); $instance['title'] = strip_tags($new_instance['title']); $instance['cantidad'] = strip_tags($new_instance['cantidad']); if(!is_numeric(strip_tags($new_instance['cantidad']))){ $instance['cantidad'] = '0'; } return $instance; } public function form($instance) { $defaults = array( 'title' => __( 'Posts más vistos' , 'appyn' ), 'cantidad' => 5 ); $instance = wp_parse_args( (array) $instance, $defaults ); ?> <p> <label for="<?php echo $this->get_field_id('title'); ?>"><?php echo __( 'Título', 'appyn' ); ?>:</label> <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo esc_attr($instance["title"]); ?>" /> </p> <p> <label for="<?php echo $this->get_field_id('cantidad'); ?>"><?php echo __( 'Número de entradas a mostrar', 'appyn' ); ?>:</label> <input id="<?php echo $this->get_field_id('cantidad'); ?>" name="<?php echo $this->get_field_name('cantidad'); ?>" type="text" value="<?php echo esc_attr($instance["cantidad"]); ?>" size="3" maxlength="2" /> </p> <?php } } add_action('widgets_init', function() { register_widget("mas_vistos_blog_Widget"); }); onedrive/composer.json 0000644 00000000107 15151400311 0011066 0 ustar 00 { "require": { "krizalys/onedrive-php-sdk": "^3.1" } } onedrive/composer.lock 0000644 00000062452 15151400311 0011060 0 ustar 00 { "_readme": [ "This file locks the dependencies of your project to a known state", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], "content-hash": "598c8749ad341c27aa83da86f7bbf91d", "packages": [ { "name": "guzzlehttp/guzzle", "version": "7.4.1", "source": { "type": "git", "url": "https://github.com/guzzle/guzzle.git", "reference": "ee0a041b1760e6a53d2a39c8c34115adc2af2c79" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/guzzle/guzzle/zipball/ee0a041b1760e6a53d2a39c8c34115adc2af2c79", "reference": "ee0a041b1760e6a53d2a39c8c34115adc2af2c79", "shasum": "" }, "require": { "ext-json": "*", "guzzlehttp/promises": "^1.5", "guzzlehttp/psr7": "^1.8.3 || ^2.1", "php": "^7.2.5 || ^8.0", "psr/http-client": "^1.0", "symfony/deprecation-contracts": "^2.2 || ^3.0" }, "provide": { "psr/http-client-implementation": "1.0" }, "require-dev": { "bamarni/composer-bin-plugin": "^1.4.1", "ext-curl": "*", "php-http/client-integration-tests": "^3.0", "phpunit/phpunit": "^8.5.5 || ^9.3.5", "psr/log": "^1.1 || ^2.0 || ^3.0" }, "suggest": { "ext-curl": "Required for CURL handler support", "ext-intl": "Required for Internationalized Domain Name (IDN) support", "psr/log": "Required for using the Log middleware" }, "type": "library", "extra": { "branch-alias": { "dev-master": "7.4-dev" } }, "autoload": { "psr-4": { "GuzzleHttp\\": "src/" }, "files": [ "src/functions_include.php" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], "authors": [ { "name": "Graham Campbell", "email": "hello@gjcampbell.co.uk", "homepage": "https://github.com/GrahamCampbell" }, { "name": "Michael Dowling", "email": "mtdowling@gmail.com", "homepage": "https://github.com/mtdowling" }, { "name": "Jeremy Lindblom", "email": "jeremeamia@gmail.com", "homepage": "https://github.com/jeremeamia" }, { "name": "George Mponos", "email": "gmponos@gmail.com", "homepage": "https://github.com/gmponos" }, { "name": "Tobias Nyholm", "email": "tobias.nyholm@gmail.com", "homepage": "https://github.com/Nyholm" }, { "name": "Márk Sági-Kazár", "email": "mark.sagikazar@gmail.com", "homepage": "https://github.com/sagikazarmark" }, { "name": "Tobias Schultze", "email": "webmaster@tubo-world.de", "homepage": "https://github.com/Tobion" } ], "description": "Guzzle is a PHP HTTP client library", "keywords": [ "client", "curl", "framework", "http", "http client", "psr-18", "psr-7", "rest", "web service" ], "support": { "issues": "https://github.com/guzzle/guzzle/issues", "source": "https://github.com/guzzle/guzzle/tree/7.4.1" }, "funding": [ { "url": "https://github.com/GrahamCampbell", "type": "github" }, { "url": "https://github.com/Nyholm", "type": "github" }, { "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/guzzle", "type": "tidelift" } ], "time": "2021-12-06T18:43:05+00:00" }, { "name": "guzzlehttp/promises", "version": "1.5.1", "source": { "type": "git", "url": "https://github.com/guzzle/promises.git", "reference": "fe752aedc9fd8fcca3fe7ad05d419d32998a06da" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/guzzle/promises/zipball/fe752aedc9fd8fcca3fe7ad05d419d32998a06da", "reference": "fe752aedc9fd8fcca3fe7ad05d419d32998a06da", "shasum": "" }, "require": { "php": ">=5.5" }, "require-dev": { "symfony/phpunit-bridge": "^4.4 || ^5.1" }, "type": "library", "extra": { "branch-alias": { "dev-master": "1.5-dev" } }, "autoload": { "psr-4": { "GuzzleHttp\\Promise\\": "src/" }, "files": [ "src/functions_include.php" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], "authors": [ { "name": "Graham Campbell", "email": "hello@gjcampbell.co.uk", "homepage": "https://github.com/GrahamCampbell" }, { "name": "Michael Dowling", "email": "mtdowling@gmail.com", "homepage": "https://github.com/mtdowling" }, { "name": "Tobias Nyholm", "email": "tobias.nyholm@gmail.com", "homepage": "https://github.com/Nyholm" }, { "name": "Tobias Schultze", "email": "webmaster@tubo-world.de", "homepage": "https://github.com/Tobion" } ], "description": "Guzzle promises library", "keywords": [ "promise" ], "support": { "issues": "https://github.com/guzzle/promises/issues", "source": "https://github.com/guzzle/promises/tree/1.5.1" }, "funding": [ { "url": "https://github.com/GrahamCampbell", "type": "github" }, { "url": "https://github.com/Nyholm", "type": "github" }, { "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/promises", "type": "tidelift" } ], "time": "2021-10-22T20:56:57+00:00" }, { "name": "guzzlehttp/psr7", "version": "2.1.0", "source": { "type": "git", "url": "https://github.com/guzzle/psr7.git", "reference": "089edd38f5b8abba6cb01567c2a8aaa47cec4c72" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/guzzle/psr7/zipball/089edd38f5b8abba6cb01567c2a8aaa47cec4c72", "reference": "089edd38f5b8abba6cb01567c2a8aaa47cec4c72", "shasum": "" }, "require": { "php": "^7.2.5 || ^8.0", "psr/http-factory": "^1.0", "psr/http-message": "^1.0", "ralouphie/getallheaders": "^3.0" }, "provide": { "psr/http-factory-implementation": "1.0", "psr/http-message-implementation": "1.0" }, "require-dev": { "bamarni/composer-bin-plugin": "^1.4.1", "http-interop/http-factory-tests": "^0.9", "phpunit/phpunit": "^8.5.8 || ^9.3.10" }, "suggest": { "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses" }, "type": "library", "extra": { "branch-alias": { "dev-master": "2.1-dev" } }, "autoload": { "psr-4": { "GuzzleHttp\\Psr7\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], "authors": [ { "name": "Graham Campbell", "email": "hello@gjcampbell.co.uk", "homepage": "https://github.com/GrahamCampbell" }, { "name": "Michael Dowling", "email": "mtdowling@gmail.com", "homepage": "https://github.com/mtdowling" }, { "name": "George Mponos", "email": "gmponos@gmail.com", "homepage": "https://github.com/gmponos" }, { "name": "Tobias Nyholm", "email": "tobias.nyholm@gmail.com", "homepage": "https://github.com/Nyholm" }, { "name": "Márk Sági-Kazár", "email": "mark.sagikazar@gmail.com", "homepage": "https://github.com/sagikazarmark" }, { "name": "Tobias Schultze", "email": "webmaster@tubo-world.de", "homepage": "https://github.com/Tobion" }, { "name": "Márk Sági-Kazár", "email": "mark.sagikazar@gmail.com", "homepage": "https://sagikazarmark.hu" } ], "description": "PSR-7 message implementation that also provides common utility methods", "keywords": [ "http", "message", "psr-7", "request", "response", "stream", "uri", "url" ], "support": { "issues": "https://github.com/guzzle/psr7/issues", "source": "https://github.com/guzzle/psr7/tree/2.1.0" }, "funding": [ { "url": "https://github.com/GrahamCampbell", "type": "github" }, { "url": "https://github.com/Nyholm", "type": "github" }, { "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/psr7", "type": "tidelift" } ], "time": "2021-10-06T17:43:30+00:00" }, { "name": "krizalys/onedrive-php-sdk", "version": "3.1.0", "source": { "type": "git", "url": "https://github.com/krizalys/onedrive-php-sdk.git", "reference": "a300e86c855aefc35d5ef37ce8a69a8b61ccedea" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/krizalys/onedrive-php-sdk/zipball/a300e86c855aefc35d5ef37ce8a69a8b61ccedea", "reference": "a300e86c855aefc35d5ef37ce8a69a8b61ccedea", "shasum": "" }, "require": { "guzzlehttp/guzzle": ">=6.3.3", "microsoft/microsoft-graph": "^1.7.0", "php": ">=7.3" }, "require-dev": { "brianium/paratest": "^6.0.0", "php-webdriver/webdriver": "^1.7.0", "phpunit/phpunit": "^9.0.0", "symfony/process": "^4.0.0" }, "type": "library", "autoload": { "psr-4": { "Krizalys\\Onedrive\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause" ], "authors": [ { "name": "Christophe Vidal", "homepage": "http://www.krizalys.com/" } ], "description": "OneDrive SDK for PHP.", "homepage": "https://github.com/krizalys/onedrive-php-sdk", "keywords": [ "OneDrive", "krizalys", "php", "sdk" ], "support": { "email": "support@krizalys.com", "issues": "https://github.com/krizalys/onedrive-php-sdk/issues", "source": "https://github.com/krizalys/onedrive-php-sdk", "wiki": "https://github.com/krizalys/onedrive-php-sdk/wiki" }, "time": "2021-04-18T05:53:24+00:00" }, { "name": "microsoft/microsoft-graph", "version": "1.51.0", "source": { "type": "git", "url": "https://github.com/microsoftgraph/msgraph-sdk-php.git", "reference": "f9c5fccb5de475c6676d3131421a99d4b07ad583" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/microsoftgraph/msgraph-sdk-php/zipball/f9c5fccb5de475c6676d3131421a99d4b07ad583", "reference": "f9c5fccb5de475c6676d3131421a99d4b07ad583", "shasum": "" }, "require": { "ext-json": "*", "guzzlehttp/guzzle": "^6.0 || ^7.0", "php": "^8.0 || ^7.3", "psr/http-message": "^1.0" }, "require-dev": { "mikey179/vfsstream": "^1.2", "phpstan/phpstan": "^0.12.90 || ^1.0.0", "phpunit/phpunit": "^8.0 || ^9.0" }, "type": "library", "autoload": { "psr-4": { "Beta\\Microsoft\\Graph\\": "src/Beta/Microsoft/Graph/", "Microsoft\\Graph\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], "authors": [ { "name": "Microsoft Graph Client Tooling", "email": "graphtooling@service.microsoft.com", "role": "Developer" } ], "description": "The Microsoft Graph SDK for PHP", "homepage": "https://developer.microsoft.com/en-us/graph", "support": { "issues": "https://github.com/microsoftgraph/msgraph-sdk-php/issues", "source": "https://github.com/microsoftgraph/msgraph-sdk-php/tree/1.51.0" }, "time": "2022-01-28T05:27:12+00:00" }, { "name": "psr/http-client", "version": "1.0.1", "source": { "type": "git", "url": "https://github.com/php-fig/http-client.git", "reference": "2dfb5f6c5eff0e91e20e913f8c5452ed95b86621" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/php-fig/http-client/zipball/2dfb5f6c5eff0e91e20e913f8c5452ed95b86621", "reference": "2dfb5f6c5eff0e91e20e913f8c5452ed95b86621", "shasum": "" }, "require": { "php": "^7.0 || ^8.0", "psr/http-message": "^1.0" }, "type": "library", "extra": { "branch-alias": { "dev-master": "1.0.x-dev" } }, "autoload": { "psr-4": { "Psr\\Http\\Client\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], "authors": [ { "name": "PHP-FIG", "homepage": "http://www.php-fig.org/" } ], "description": "Common interface for HTTP clients", "homepage": "https://github.com/php-fig/http-client", "keywords": [ "http", "http-client", "psr", "psr-18" ], "support": { "source": "https://github.com/php-fig/http-client/tree/master" }, "time": "2020-06-29T06:28:15+00:00" }, { "name": "psr/http-factory", "version": "1.0.1", "source": { "type": "git", "url": "https://github.com/php-fig/http-factory.git", "reference": "12ac7fcd07e5b077433f5f2bee95b3a771bf61be" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/php-fig/http-factory/zipball/12ac7fcd07e5b077433f5f2bee95b3a771bf61be", "reference": "12ac7fcd07e5b077433f5f2bee95b3a771bf61be", "shasum": "" }, "require": { "php": ">=7.0.0", "psr/http-message": "^1.0" }, "type": "library", "extra": { "branch-alias": { "dev-master": "1.0.x-dev" } }, "autoload": { "psr-4": { "Psr\\Http\\Message\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], "authors": [ { "name": "PHP-FIG", "homepage": "http://www.php-fig.org/" } ], "description": "Common interfaces for PSR-7 HTTP message factories", "keywords": [ "factory", "http", "message", "psr", "psr-17", "psr-7", "request", "response" ], "support": { "source": "https://github.com/php-fig/http-factory/tree/master" }, "time": "2019-04-30T12:38:16+00:00" }, { "name": "psr/http-message", "version": "1.0.1", "source": { "type": "git", "url": "https://github.com/php-fig/http-message.git", "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363", "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363", "shasum": "" }, "require": { "php": ">=5.3.0" }, "type": "library", "extra": { "branch-alias": { "dev-master": "1.0.x-dev" } }, "autoload": { "psr-4": { "Psr\\Http\\Message\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], "authors": [ { "name": "PHP-FIG", "homepage": "http://www.php-fig.org/" } ], "description": "Common interface for HTTP messages", "homepage": "https://github.com/php-fig/http-message", "keywords": [ "http", "http-message", "psr", "psr-7", "request", "response" ], "support": { "source": "https://github.com/php-fig/http-message/tree/master" }, "time": "2016-08-06T14:39:51+00:00" }, { "name": "ralouphie/getallheaders", "version": "3.0.3", "source": { "type": "git", "url": "https://github.com/ralouphie/getallheaders.git", "reference": "120b605dfeb996808c31b6477290a714d356e822" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/120b605dfeb996808c31b6477290a714d356e822", "reference": "120b605dfeb996808c31b6477290a714d356e822", "shasum": "" }, "require": { "php": ">=5.6" }, "require-dev": { "php-coveralls/php-coveralls": "^2.1", "phpunit/phpunit": "^5 || ^6.5" }, "type": "library", "autoload": { "files": [ "src/getallheaders.php" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], "authors": [ { "name": "Ralph Khattar", "email": "ralph.khattar@gmail.com" } ], "description": "A polyfill for getallheaders.", "support": { "issues": "https://github.com/ralouphie/getallheaders/issues", "source": "https://github.com/ralouphie/getallheaders/tree/develop" }, "time": "2019-03-08T08:55:37+00:00" }, { "name": "symfony/deprecation-contracts", "version": "v3.0.0", "source": { "type": "git", "url": "https://github.com/symfony/deprecation-contracts.git", "reference": "c726b64c1ccfe2896cb7df2e1331c357ad1c8ced" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/c726b64c1ccfe2896cb7df2e1331c357ad1c8ced", "reference": "c726b64c1ccfe2896cb7df2e1331c357ad1c8ced", "shasum": "" }, "require": { "php": ">=8.0.2" }, "type": "library", "extra": { "branch-alias": { "dev-main": "3.0-dev" }, "thanks": { "name": "symfony/contracts", "url": "https://github.com/symfony/contracts" } }, "autoload": { "files": [ "function.php" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], "authors": [ { "name": "Nicolas Grekas", "email": "p@tchwork.com" }, { "name": "Symfony Community", "homepage": "https://symfony.com/contributors" } ], "description": "A generic function and convention to trigger deprecation notices", "homepage": "https://symfony.com", "support": { "source": "https://github.com/symfony/deprecation-contracts/tree/v3.0.0" }, "funding": [ { "url": "https://symfony.com/sponsor", "type": "custom" }, { "url": "https://github.com/fabpot", "type": "github" }, { "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", "type": "tidelift" } ], "time": "2021-11-01T23:48:49+00:00" } ], "packages-dev": [], "aliases": [], "minimum-stability": "stable", "stability-flags": [], "prefer-stable": false, "prefer-lowest": false, "platform": [], "platform-dev": [], "plugin-api-version": "2.0.0" } onedrive/vendor/symfony/deprecation-contracts/LICENSE 0000644 00000002051 15151400312 0016646 0 ustar 00 Copyright (c) 2020-2021 Fabien Potencier Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. onedrive/vendor/symfony/deprecation-contracts/.gitignore 0000644 00000000042 15151400312 0017627 0 ustar 00 vendor/ composer.lock phpunit.xml onedrive/vendor/symfony/deprecation-contracts/composer.json 0000644 00000001513 15151400312 0020365 0 ustar 00 { "name": "symfony/deprecation-contracts", "type": "library", "description": "A generic function and convention to trigger deprecation notices", "homepage": "https://symfony.com", "license": "MIT", "authors": [ { "name": "Nicolas Grekas", "email": "p@tchwork.com" }, { "name": "Symfony Community", "homepage": "https://symfony.com/contributors" } ], "require": { "php": ">=8.0.2" }, "autoload": { "files": [ "function.php" ] }, "minimum-stability": "dev", "extra": { "branch-alias": { "dev-main": "3.0-dev" }, "thanks": { "name": "symfony/contracts", "url": "https://github.com/symfony/contracts" } } } onedrive/vendor/symfony/deprecation-contracts/function.php 0000644 00000001766 15151400312 0020213 0 ustar 00 <?php /* * This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ if (!function_exists('trigger_deprecation')) { /** * Triggers a silenced deprecation notice. * * @param string $package The name of the Composer package that is triggering the deprecation * @param string $version The version of the package that introduced the deprecation * @param string $message The message of the deprecation * @param mixed ...$args Values to insert in the message using printf() formatting * * @author Nicolas Grekas <p@tchwork.com> */ function trigger_deprecation(string $package, string $version, string $message, mixed ...$args): void { @trigger_error(($package || $version ? "Since $package $version: " : '').($args ? vsprintf($message, $args) : $message), \E_USER_DEPRECATED); } } onedrive/vendor/symfony/deprecation-contracts/CHANGELOG.md 0000644 00000000235 15151400312 0017454 0 ustar 00 CHANGELOG ========= The changelog is maintained for all Symfony contracts at the following URL: https://github.com/symfony/contracts/blob/main/CHANGELOG.md onedrive/vendor/symfony/deprecation-contracts/README.md 0000644 00000002264 15151400312 0017126 0 ustar 00 Symfony Deprecation Contracts ============================= A generic function and convention to trigger deprecation notices. This package provides a single global function named `trigger_deprecation()` that triggers silenced deprecation notices. By using a custom PHP error handler such as the one provided by the Symfony ErrorHandler component, the triggered deprecations can be caught and logged for later discovery, both on dev and prod environments. The function requires at least 3 arguments: - the name of the Composer package that is triggering the deprecation - the version of the package that introduced the deprecation - the message of the deprecation - more arguments can be provided: they will be inserted in the message using `printf()` formatting Example: ```php trigger_deprecation('symfony/blockchain', '8.9', 'Using "%s" is deprecated, use "%s" instead.', 'bitcoin', 'fabcoin'); ``` This will generate the following message: `Since symfony/blockchain 8.9: Using "bitcoin" is deprecated, use "fabcoin" instead.` While not necessarily recommended, the deprecation notices can be completely ignored by declaring an empty `function trigger_deprecation() {}` in your application. onedrive/vendor/autoload.php 0000644 00000000262 15151400312 0012165 0 ustar 00 <?php // autoload.php @generated by Composer require_once __DIR__ . '/composer/autoload_real.php'; return ComposerAutoloaderInit9e591b2760a73a461bdc29e54afbf958::getLoader(); onedrive/vendor/ralouphie/getallheaders/LICENSE 0000644 00000002070 15151400312 0015444 0 ustar 00 The MIT License (MIT) Copyright (c) 2014 Ralph Khattar Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. onedrive/vendor/ralouphie/getallheaders/composer.json 0000644 00000000721 15151400312 0017162 0 ustar 00 { "name": "ralouphie/getallheaders", "description": "A polyfill for getallheaders.", "license": "MIT", "authors": [ { "name": "Ralph Khattar", "email": "ralph.khattar@gmail.com" } ], "require": { "php": ">=5.6" }, "require-dev": { "phpunit/phpunit": "^5 || ^6.5", "php-coveralls/php-coveralls": "^2.1" }, "autoload": { "files": ["src/getallheaders.php"] }, "autoload-dev": { "psr-4": { "getallheaders\\Tests\\": "tests/" } } } onedrive/vendor/ralouphie/getallheaders/src/getallheaders.php 0000644 00000003150 15151400312 0020543 0 ustar 00 <?php if (!function_exists('getallheaders')) { /** * Get all HTTP header key/values as an associative array for the current request. * * @return string[string] The HTTP header key/value pairs. */ function getallheaders() { $headers = array(); $copy_server = array( 'CONTENT_TYPE' => 'Content-Type', 'CONTENT_LENGTH' => 'Content-Length', 'CONTENT_MD5' => 'Content-Md5', ); foreach ($_SERVER as $key => $value) { if (substr($key, 0, 5) === 'HTTP_') { $key = substr($key, 5); if (!isset($copy_server[$key]) || !isset($_SERVER[$key])) { $key = str_replace(' ', '-', ucwords(strtolower(str_replace('_', ' ', $key)))); $headers[$key] = $value; } } elseif (isset($copy_server[$key])) { $headers[$copy_server[$key]] = $value; } } if (!isset($headers['Authorization'])) { if (isset($_SERVER['REDIRECT_HTTP_AUTHORIZATION'])) { $headers['Authorization'] = $_SERVER['REDIRECT_HTTP_AUTHORIZATION']; } elseif (isset($_SERVER['PHP_AUTH_USER'])) { $basic_pass = isset($_SERVER['PHP_AUTH_PW']) ? $_SERVER['PHP_AUTH_PW'] : ''; $headers['Authorization'] = 'Basic ' . base64_encode($_SERVER['PHP_AUTH_USER'] . ':' . $basic_pass); } elseif (isset($_SERVER['PHP_AUTH_DIGEST'])) { $headers['Authorization'] = $_SERVER['PHP_AUTH_DIGEST']; } } return $headers; } } onedrive/vendor/ralouphie/getallheaders/README.md 0000644 00000002100 15151400312 0015710 0 ustar 00 getallheaders ============= PHP `getallheaders()` polyfill. Compatible with PHP >= 5.3. [](https://travis-ci.org/ralouphie/getallheaders) [](https://coveralls.io/r/ralouphie/getallheaders?branch=master) [](https://packagist.org/packages/ralouphie/getallheaders) [](https://packagist.org/packages/ralouphie/getallheaders) [](https://packagist.org/packages/ralouphie/getallheaders) This is a simple polyfill for [`getallheaders()`](http://www.php.net/manual/en/function.getallheaders.php). ## Install For PHP version **`>= 5.6`**: ``` composer require ralouphie/getallheaders ``` For PHP version **`< 5.6`**: ``` composer require ralouphie/getallheaders "^2" ``` onedrive/vendor/microsoft/microsoft-graph/phpdoc.dist.xml 0000644 00000001205 15151400312 0017714 0 ustar 00 <?xml version="1.0" encoding="UTF-8" ?> <phpdocumentor configVersion="3" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="https://www.phpdoc.org" xsi:noNamespaceSchemaLocation="https://docs.phpdoc.org/latest/phpdoc.xsd" > <paths> <output>docs</output> </paths> <version number="3.0.0"> <api> <source dsn="."> <path>src/Core</path> <path>src/Exception</path> <path>src/Http</path> <path>src/Graph.php</path> </source> </api> </version> </phpdocumentor> onedrive/vendor/microsoft/microsoft-graph/.github/workflows/update-docs.yml 0000644 00000003616 15151400313 0023314 0 ustar 00 # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. name: "Update Docs" on: push: branches: dev defaults: run: shell: bash jobs: run-php-documentor: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2.3.4 with: ref: ${{ github.ref }} - uses: docker://phpdoc/phpdoc:3.0 with: config: ./phpdoc.dist.xml - name: Create unique docs branch name run: echo "BRANCH=fix/update-docs/$(date +%s)" >> $GITHUB_ENV - name: Create and checkout docs branch run: git checkout -b ${{ env.BRANCH }} - name: Run PHPDocumentor container run: docker run --name phpDoc --rm -v $(pwd):/data phpdoc/phpdoc:3.0 run - name: Config Git user run: | git config --global user.email "GraphTooling@service.microsoft.com" git config --global user.name "Microsoft Graph DevX Tooling" - name: Commit changes to docs/ folder (if any) run: | if git add . && git commit -m "Update docs/ folder"; then git push origin ${{ env.BRANCH }} && echo "CREATE_PR=true" >> $GITHUB_ENV else echo "CREATE_PR=false" >> $GITHUB_ENV fi - name: Create PR if: ${{ env.CREATE_PR == 'true' }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} MESSAGE_TITLE: Generated docs using PHPDocumentor MESSAGE_BODY: "This pull request was automatically created by GitHub Action `${{ github.workflow }}`. \n\n The action runs PHPDocumentor against the latest changes merged to `${{ github.ref }}`." LABELS: generated run: | curl -fsSL https://github.com/github/hub/raw/master/script/get | bash -s 2.14.1 bin/hub pull-request -b dev -m "$MESSAGE_TITLE" -m "$MESSAGE_BODY" -l "$LABELS" onedrive/vendor/microsoft/microsoft-graph/.github/workflows/create-beta-pull-request.yml 0000644 00000006031 15151400313 0025712 0 ustar 00 # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. # This action will automatically create a pull request against dev if the pushed branch # has a branch path spec likev 1.0/pipelinebuild/*. Configure this action by updating the # environment variable values[0]. name: "create beta pull request" # Controls when the action will run. Triggers the workflow on push # events but only for branches with the following branch spec: "beta/pipelinebuild/*" on: push: branches: - "beta/pipelinebuild/*" paths: - 'src/Beta/**/*.php' - '!src/Core/GraphConstants.php' defaults: run: shell: bash # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: bump-minor-version: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - name: Git config user run: | git config --global user.email "GraphTooling@service.microsoft.com" git config --global user.name "Microsoft Graph DevX Tooling" - name: Run increment script run: php scripts/IncrementMinorVersion.php - name: Commit and push changes if any run: if git commit -am "Bump up minor version"; then git push origin $GITHUB_REF; fi create-pull-request: needs: bump-minor-version # The type of runner that the job will run on runs-on: ubuntu-latest # https://github.com/actions/virtual-environments/blob/master/images/linux/Ubuntu1804-README.md # Steps represent a sequence of tasks that will be executed as part of the job steps: # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - uses: actions/checkout@v2.3.4 # Create a pull request [1] - name: Create PR using the GitHub REST API via hub env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} MESSAGE_TITLE: Generated beta models using Typewriter MESSAGE_BODY: "This pull request was automatically created by the GitHub Action, **${{github.workflow}}**. \n\n The commit hash is _${{github.sha}}_. \n\n **Important** Check for unexpected deletions or changes in this PR. See [beta_metadata.xml](https://github.com/microsoftgraph/msgraph-metadata/blob/master/beta_metadata.xml) for metadata changes. \n\n Make sure the version number is incremented in /src/Core/GraphConstants.php. Compare the version against the latest release on [packagist.org](https://packagist.org/packages/microsoft/microsoft-graph) and update the version in src/Core/GraphConstants." LABELS: generated BASE: dev run: | curl -fsSL https://github.com/github/hub/raw/master/script/get | bash -s 2.14.1 bin/hub pull-request -b "$BASE" -h "$GITHUB_REF" -m "$MESSAGE_TITLE" -m "$MESSAGE_BODY" -r "$REVIEWERS" -l "$LABELS" # References # [0] https://help.github.com/en/actions/configuring-and-managing-workflows/using-environment-variables # [1] https://hub.github.com/hub-pull-request.1.html # https://help.github.com/en/actions/configuring-and-managing-workflows/authenticating-with-the-github_token onedrive/vendor/microsoft/microsoft-graph/.github/workflows/create-v1.0-pull-request.yml 0000644 00000006112 15151400313 0025463 0 ustar 00 # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. # This action will automatically create a pull request against dev if the pushed branch # has a branch path spec likev 1.0/pipelinebuild/*. Configure this action by updating the # environment variable values[0]. name: "create pull request" # Controls when the action will run. Triggers the workflow on push # events but only for branches with the following branch spec: "v1.0/pipelinebuild/*" on: push: branches: - "v1.0/pipelinebuild/*" paths: - 'src/Model/**/*.php' - 'src/**/Model/**/*.php' - '!src/Core/GraphConstants.php' - '!src/Beta/**/*.php' defaults: run: shell: bash # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: bump-minor-version: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - name: Git config user run: | git config --global user.email "GraphTooling@service.microsoft.com" git config --global user.name "Microsoft Graph DevX Tooling" - name: Run increment script run: php scripts/IncrementMinorVersion.php - name: Commit and push changes if any run: if git commit -am "Bump up minor version"; then git push origin $GITHUB_REF; fi create-pull-request: needs: bump-minor-version # The type of runner that the job will run on runs-on: ubuntu-latest # https://github.com/actions/virtual-environments/blob/master/images/linux/Ubuntu1804-README.md # Steps represent a sequence of tasks that will be executed as part of the job steps: # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - uses: actions/checkout@v2.3.4 # Create a pull request [1] - name: Create PR using the GitHub REST API via hub env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} MESSAGE_TITLE: Generated models using Typewriter MESSAGE_BODY: "This pull request was automatically created by the GitHub Action, **${{github.workflow}}**. \n\n The commit hash is _${{github.sha}}_. \n\n **Important** Check for unexpected deletions or changes in this PR. See [v1.0_metadata.xml](https://github.com/microsoftgraph/msgraph-metadata/blob/master/v1.0_metadata.xml) for metadata changes. \n\n Make sure the version number is incremented in /src/Core/GraphConstants.php. Compare the version against the latest release on [packagist.org](https://packagist.org/packages/microsoft/microsoft-graph) and update the version in src/Core/GraphConstants." LABELS: generated BASE: dev run: | curl -fsSL https://github.com/github/hub/raw/master/script/get | bash -s 2.14.1 bin/hub pull-request -b "$BASE" -h "$GITHUB_REF" -m "$MESSAGE_TITLE" -m "$MESSAGE_BODY" -r "$REVIEWERS" -l "$LABELS" # References # [0] https://help.github.com/en/actions/configuring-and-managing-workflows/using-environment-variables # [1] https://hub.github.com/hub-pull-request.1.html # https://help.github.com/en/actions/configuring-and-managing-workflows/authenticating-with-the-github_token onedrive/vendor/microsoft/microsoft-graph/.github/workflows/pr-validation.yml 0000644 00000002107 15151400313 0023647 0 ustar 00 # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. name: "Validate Pull Request" on: push: branches: [ main, dev ] pull_request: branches: [ main, dev ] # Add assigned to defaults as a hack to easily trigger code-gen PRs to run validation types: [assigned, opened, synchronize, reopened] defaults: run: shell: bash jobs: validate-pull-request: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2.3.4 - name: Validate composer file run: | composer validate - name: Install dependencies run: | composer install - name: run tests run : | vendor/bin/phpunit --exclude-group functional run-static-analysis: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2.3.4 - name: Validate composer file run: | composer validate - name: Install dependencies run: | composer install - name: Run static analysis run: | vendor/bin/phpstan analyse --memory-limit=1500M --error-format=github onedrive/vendor/microsoft/microsoft-graph/.github/workflows/tag-release.yml 0000644 00000001341 15151400313 0023266 0 ustar 00 # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. # Adds a tag to main after a PR is merged succesfully. name: "tag release" on: push: branches: - main defaults: run: shell: bash jobs: create-tag: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - name: Get SDK version and set environment variable run: | SDK_VERSION=$(grep 'SDK_VERSION' src/Core/GraphConstants.php | grep -oE '[0-9]+\.[0-9]+\.([0-9]+|[0-9]+-[a-z]+)') echo "SDK_VERSION=$SDK_VERSION" >> $GITHUB_ENV - name: Create and publish tag run: | echo "SDK_VERSION is:"$SDK_VERSION git tag $SDK_VERSION && git push origin $SDK_VERSION onedrive/vendor/microsoft/microsoft-graph/.github/CODEOWNERS 0000644 00000000117 15151400313 0017710 0 ustar 00 * @ddyett @MichaelMainer @nikithauc @zengin @silaskenneth @Ndiritu @shemogumbe onedrive/vendor/microsoft/microsoft-graph/.github/dependabot.yml 0000644 00000000366 15151400314 0021154 0 ustar 00 version: 2 updates: - package-ecosystem: composer directory: "/" schedule: interval: daily open-pull-requests-limit: 10 - package-ecosystem: github-actions directory: "/" schedule: interval: daily open-pull-requests-limit: 10 onedrive/vendor/microsoft/microsoft-graph/LICENSE 0000644 00000002150 15151400314 0015762 0 ustar 00 microsoftgraph-msgraph-sdk-php Copyright (c) Microsoft Corporation All rights reserved. MIT License Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. onedrive/vendor/microsoft/microsoft-graph/tests/Functional/Resources/excelTestResource.xlsx 0000644 00000046137 15151400314 0026600 0 ustar 00 PK ! ���� � [Content_Types].xml �(� ̗Qo� ��'�;X�N1I�u����Uj�\b��vɷߙ�Q5�ɬZ/F6�d�_n;W�CB|#f�TT�u0֯���BTH�傇F� �����.V<�c#Z��EJ�-t ��s�*�N����Jo���tz.u��&�k��+�ԝ��ۖ??�,���øު*Fg�"���e2 ���`���X�Ƙ@l�suL�� q`(�A���>FU�������C���y9��y?y;�5P]�D?TDZ˭��C�,C���E�.M^��S�?q�σQ�f62H_�qV�B8>����B8>�qQ��B8f�R@�J��A����̉#i� �NdY�s���z`=:�s����27co{�?v�?v��?v����j���'���.��S��ux�� OEo?{YYؗ���ǽ#��[�s�[�[�� �� PK ! �U0#� L _rels/.rels �(� ��MO�0��H����ݐBKwAH�!T~�I����$ݿ'T�G�~����<���!��4��;#�w����qu*&r�Fq���v���GJy(v��*����K��#F��D��.W ��=��Z�MY�b���BS���7��ϛז�� ?�9L�ҙ�sbgٮ|�l!��USh9i�b�r:"y_dl��D���|-N��R"4�2�G�%��Z�4�˝y�7 ë��ɂ��� �� PK ! �7L � xl/_rels/workbook.xml.rels �(� ���j�0��{���ֶ�ڋ�Ao��B<�&�d|�Ǭ�r�ɍpN�|?�/���m|�6���È �*jYe��!��L�Q2҃!���n� ��%#��n�4�v��.�e&TH�R*�2�J]ю���&Q�R=�A��Ȉ>N��wN��٪,kϊ� � ���� �2]����2tXل����0�bNc���9��֘���7���`֞�Y��$s�X���P��c�2�O�:�9ԙ�3L�:���f�f�z3+ g ���oil���#g�f��l=�lѠf����x���>���GC/. � �� PK ! cP� xl/workbook.xml�UKs�0�w�����c�s0��@��6�P�\�{�dɕ�@��ޕ(�=��^���><���{�� �.B�He��&!���'�6Td�K yM.��ߍvRmWRn=:!�1�0t�CA��,A��Z��<�M�K4�9�)x� �nPP&�a�ނ!�k�L��9�(�Ԡ�:g�>��[� ��U駲(b�83/�xE:����c��sD��t�R%�\�� N���AB���v���-�N<N��f�@���^]�����ר�#��T�+/�5��Y`��(؍��IbPW܀�D ��b�_��{�K̎7�oS�Eai��K�!]�{jr�R<!��RA)���E�����Ϥ`����5����o�ٽ�*�ڜS�wZV*�ld����/rDSKkPGt؟27�d�ӿs`����L���������L��V�p��&7 �[x�fJ���QP�xC}�]%$v�5�vB�n��+#�a�Z�[[)�SC�u��:8�F+�4�k閵�JZ*��p�"f�ˉ�U!)���n@�O!��l.w�`JqC��ٴ��C�a�Ω�4Ma_��vμ3� Tqڰ�mht����ACvj ۱6�;U�1�XNױ���fgh��?U��T�n̩23%�SV"��Zyp�|����<�0v֚I����ln����(�5 �A�`\��BK)Oq��ŕV�5�\�ao>i3�=��=�ë^8��p��q��q��O�ִӛ�L�;?��X�Q3<�����Յ���gsX_S�c���}}�:8j� �� PK ! `��) � xl/worksheets/sheet4.xml���n�0��#�;X�7r�"�j&���HU5��cX�1c;���cӐN�E�I|9|����=�D;n��m��Q�o�.E[��ϧ�oYGےJ������/�^��m8w��q�\�bY��#��n*mu�55���)I�(�EE�{Bjna��/5�*b����쉦�-8E�f��1�:@����)���V��P�!�Pvb����h�+7��X�=�'@*�R@����*Ǐq��`Rd�?���wk�۽�z�/Ve�# X.9�# ;��K���L�o`��d �_��Oa@/���[�^�����q�)��N��[ �Q2�T�% �)� ��'�E�8�#��N�?o!����Ғ:ZdF���mG��� �uA��>B0�b��b<��*co���.��%�A nW��A-9C*�$$_�F��2����A&�.3���e�2���2���qu��?��Ek��Up�#�[&����d�Yk8�x�9�/A����?9���P�,bz�C.�)2� ۛU��a�÷�� �� PK ! �eF�; � xl/worksheets/sheet3.xml��ێ�0��+�,�/�7X�*Z5�Vն�v�+S�9�}ǰ@�FUr�|�of����I����q��TTy���><bd,�RZ���� ~J�~��J�L��E�P���!!�\R㩚W��)-���Ή�5�i�,��DRQ�V!Էh�,���K^�VD�Z���6��d��I�w���)Y��V�Q�$7y�4ݖP�)�Q�i7�O�R0��ʬr�M�s�+�"��D�� \ۑ�Y����e�I5��%��3F��[�vnc����K�\���� �H �N�9�7�R��}i��7.��P�+5L�kn�X�d�2c� �")�Y�G�� FG��V`��U�ǂ����5)���I���iC����N��u. ]�3C*�>$�YDN�c��bs�o �4 �N���&m�1�{0<`�#̴�L�cf�` x�<�0�3t�i`�ۛ�f5��W�����?�,L0jZ{Z��4�ߩ�EePɳ��K�t{|�V��K(h�,ع��~qp���eJ�n6��x�����ݛ r�W��[�I��R�`�1M� �� PK ! ~���` t xl/worksheets/sheet2.xml���j�0���qڭ���A)�a0ƶ��(�il�]۷���2�7 I��r�>�����m��Q�X���uƿ����|���-Z�<_�w���7 ����7!t�^5`���K� ���RW�9��0dZ���'a��|$$�V�V�Au0`�q��@�}�;?ь�g����B��Э�ʙQɮ��d��ާ��T{H��F+��N�B�w^�� R���6�mg���ι��� G�/f���/�ʌ�}����^8VB%m���� t�%i�WH���"�-��G72H�v��w�jm=k���9s#&�(��τ,04S��u��G�U�aJz����� �� PK ! ��� � % # xl/worksheets/_rels/sheet3.xml.rels��� �0D��n�z����Ы��� �I�Fѿ7�EA�4��f�j�$��z���r�w� Χ�j��'�HÓ�z���4a�G<�"SkS ;�،4#K�e��qƔ�8����uQlT�d@��m�!�] ��9�?��5���6�K?"T��D�q��A���R�,��R_�� �� PK ! �5�X� % # xl/worksheets/_rels/sheet4.xml.rels��� �0D��n�z����Ы��� �I�Fѿ7�EA�4��f�j�$��z���r�w� Χ�j��'�HÓ�z���4a�G<�"SkS ;�،4#K�e��qƔ�8����uQlT�d@��m�!�] ��9�?��5���6�K?"T��D�q��A��߲��YPu����/ �� PK ! ;m2K� B # xl/worksheets/_rels/sheet7.xml.rels�����0E��Cx{�օCS7"�U�b��ۗ���{�e���p��6��<�f�,Ժ��ch��{�-�A�8�� -<�a�.��NNJ�ǐX��Q$��~�ٱ� ��>��I�y0��Ь�jm�_�/N��,�}W�:=RY��}<n���H�τI9�`>�H9�E��bA�w��k}�m��� �� PK ! �P�ټ % # xl/worksheets/_rels/sheet8.xml.rels��� �0����n�*�H�^D�*��t��m�Q�� � xv��f����(xpVC.3d�k�i����G� �Β�1T�rQ�iĘ��<�D������b�ӄ,�'��օ cC�<�v��Y�U��S� ��� �O�ٮmCg��#BE����:���7<�F�gA���*W� �� PK ! �g�� % # xl/worksheets/_rels/sheet9.xml.rels��� �0����nҊ�H�^D�*��t��m�Q�� � xv��f����(xpVC.3d�k�i����G� �Β�1T�rQ�iĘ��<�D������b�ӄ,�'��օ cC�<�v��Y�U��S� ��� �O�ٮmCg��#BE����:���7<�F�gA���*W� �� PK ! �D�\ � xl/sharedStrings.xmll�MK�0���(���YD�.Z]=��c;�f�G����"39� Cx!Sn��N0����U.2p���+��]݈�r�2�A%b[_^��!��+1�0�J�� V�ʏ���OV�x�z���� X#�<�H��Y�g*�)D6;�=C��u!�u]�Z�2ԥ�;,�I���Q =����p��E�P�>��K�}�=$�1a��=%�9a/ {M��=`�}3�B��ŲR��Y �ci�7�ukZ�pA9��A����3=�O�_�q���+2�]� �� PK ! ̝u� f xl/worksheets/sheet1.xml��]o�0��'�? �N �|5P�t�v1i���;`*`f�I��wl0·�U�/y��cs^����t�����!�9�NXZԻ���|w�!I����4D�T�������)�8�"D����uE�ӊ� kh J�xE$��+NI�T���y�"E�Z�5�ŃeY��'��V��� �%��/�G�*�Ů"�嵹KXՀŶ(��M�S%�ﻚq�-��7<#��[ߜ�WE`����ۂ�ּrW.8EAZ@���Y�6x�)r�@7�oA¸vT����(�{",-i�*w��Ә�e���-��M���Ѽ>�?��ɝ�f䵔���-v���0��U���:O�y��D$����u��^O/�2 ���>���㿏`K�yC-65<�DV��1>,�E��(2E�[4���X��@����&�ސ������}��z����r�H �w@7��`�BbS���1�3��ö��f�``܁Yб�]�S8��wq~�/��̂�M /�wl1lqla�;0�,����y�������c`܁Yб���y05�n��W���[00�,���~���j�� X_x�����ϗ�@1TU*���^bk�>*���"�7{H7n䫙��$ �$L����oT`��6�gg<m���տVz���'a��i�����~��ݐ�A����S�L'<�˼��&�f��%�-��Uǻ��(��7��2���F}ut_�� �� PK ! ��9eO � xl/theme/theme1.xml�Y͋7��?sw�5�%���l��$d�����QV32��%9�R(���Bo=��@ �� $���'��#��$�lJZv �G�����{zz�t�ҽ�zG��_�P�=��ؘ$Ӗk8(4|OH��e n�,�K۟~rm����Dl��I9�*�����f8��&��H�#���ޘ+�R�#��^�bP{}2!#� �J{��O�1�B �(�W��%���òB���R�!��a�1;�{�(~h�%���/�V&D�YCn��2�L`|X�s��j� �Z{�_�\��Z��ҧh4���\L�a���� �_�{�^�l� ��5��P},����5�`�+Zx J��&�J7����kk�z���^�"J��5t)�U��ծ Fw��f�Ly��hXE��b��)�bt�� �"IO.fx�F�]D�'�.�Fx3�0åJiP��� �7m���!�x�6��xb��L��+��7 /�={����=���_���*Kn%SS�Տ_����_�����7��'��Ŀ��˗���:����/�}����}��O�����!����c�&�a�����Nb!bI�t;T�ed�-u�:�6�mY��<�kqݏ�\��W���1F;�; pU�eXx8O������D��5w%�����W�Rٍ�E�E�DS�`���!Ǝ��!IJ�q&�Dzw��A�i�!9�)�!1�e�"��l�w��0�Zu�H��:�1��x�%�]*�(���w��\$�|d�B����2�?�B�d�sX���a�nߣ��FrI]:wc&����gN�$�L�g�By7�t����C�3�%�}�`��oN� ���� Q�̹×�1���Nve�6��������� �]�):Fc��[�9t�̲yN�JYe�� �cU='X@����K���x�6��[�H<�Ĉo�| �n�.�r�Tz��M�5�ċ�(��0���I�Yg�z�x]p�o��`_�=�|jH�om�!��y��t"��su�j��Snbo�� PY�NL�7?'ʞ��){��<n��S�lJ);' �M��`Y�C����d=g�W5�U����j6���Z漖9�e\o_�����l�.���[>B�\P�+t�G��x ���{���,��Y���M9�2g�s"��͠5T� ̩�TO�7c:FzX�R� ݺ�4���8�t�˪���P �����8t�d������J��Nu�uI@ɞ��1�M�� Q_�^GB��LX4,J��UK/�L�V^�Wn^�[~�dh�Ay>V~J��K�*眩�7�� %�2rO7�S�KC�-<m�0��&a�a/�Yt�-���u3w�EO�b�r�Ƈ�J"'rM�LA��ת!ܪ�Ь�O�c_�ĎPo]�N��e$y���%�̸�=$���:�� &s����寢�&:�hn� $���\���F�n;O&x$M�#���#d�4W8���V�l�ޏ�����B,����D��A9��M�*���w�`�Үy�c(Gt��D1�y �ItEG?�l`<ek����`��>u�|T+�I3?3���NMw2�p���*?D-Vi����"�u�e��@u�o8u��@0��Y��4�rv6jS;Â��Dm��Vg���z��ɨUIJ�ԁ����[mvp�G��T �J��rE_z�� �"�dV#�7o�I˿_ �A�v�F�/ՠTh��j���r?,�z��8Xd���~ Wt�]���xyKsa��"��EM\_ܗ+�/�=I�~�2hV��Z�Ym A��(4��N�W��{�^7l4|�H��v���B����ZI�o4��Ri�v��de�<M�-����? �� PK ! ~���` t xl/worksheets/sheet10.xml���j�0���qڭ���A)�a0ƶ��(�il�]۷���2�7 I��r�>�����m��Q�X���uƿ����|���-Z�<_�w���7 ����7!t�^5`���K� ���RW�9��0dZ���'a��|$$�V�V�Au0`�q��@�}�;?ь�g����B��Э�ʙQɮ��d��ާ��T{H��F+��N�B�w^�� R���6�mg���ι��� G�/f���/�ʌ�}����^8VB%m���� t�%i�WH���"�-��G72H�v��w�jm=k���9s#&�(��τ,04S��u��G�U�aJz����� �� PK ! �E< � xl/worksheets/sheet9.xml��]o�0��'�?X�/��U��Z.&US�];ƀ���|����,t�����s����^6h˵��p��B�U����=`d,mڨ�g�� ~ʿ~IwJ�ME�К��v !��\R����S*-������4���I6$�9�T��WH�5�,��6���Ѽ��7���QM�k�$��Mwǔ�@b%a^#ɒe�*MW Խ�����䓼L+�J���\�#y$����� \ۑ�e����e�I����|g�#��Rk��,2��� g�pd��k�A$OO��?�7� ^�Mc��7.�ڂfP�+5)n�XA<s�1Հ|��,�#��p��N��Xbc�����~#�>��4O��!8m�6uމ�?�.��!eo��4%['���r�96 ���A�@G������0�[0<`�f�1����x�����;\�4>�3���-0c#�=f6�@z�u��ߩ�DkP�K��{�t� �Vu��P�JY��qV���a 'W*e���u��� �6��D�̰�t"���e�Kq #�i� �� PK ! �_��H xl/worksheets/sheet8.xml��[o�0��'�?X�o�WT���TM;\;�+3�9�����vi�%7���~G'w{U��0V�:�� �D�\�^���Ǜ/�X��U�)=K�ϟ��6k[ ��Mi�\��P�t#j��(�05��6F��_RU0�i���iG��%]����%j�A��������=����Yo��U�RV�<���Ūֆ-+���ƌ�~��$7��� �:C�|� eI.�AvbD��(~�� K||~I��oƤ �R�u���S�`E%x�8a�m�WQU)}� c<C ���v|�?�=���m*�]\�� �w5�sa9��S�����(�V�)R���+��%��N��/ޘ�7i���w��i۰�����l���0L���6��`����?��~3�P���Ն^gx"DoCx^et�ʨ��D�WOϫ��Q{�Ӑѫ���2mY]���ِ��|���5*S�2= ������� �J�q]y7l%�1���%�(|��Z,�ݴ}5Cx�ڡa��ϥ@���A��;N�ծ}���q�p�i;3���*1��3ay���8Z���� �� PK ! ���W� � xl/worksheets/sheet7.xml���n�0��W�w@��s� T�U��Xi��{L� ���d��;6$4�F�Up<���oC��*���:B��F�S��z�_?���Ȓ��)yM#�F%z�? �\�ʂRe�B-#T(�˴��3��fr.*�`(vX6���,�J��W�ըU�-<�YJ�x��h�ZAK��_��'�*�E�"�u�ܧ�j@b�J�ތ(��4x��\�m y�u�$=i��H�b���jr���c�Rf2ж[���8���p~3z��-m���W=�E�IK���-?�H�2B�+8�?FA��?�ԟ�}VFs�/�w~�BٮPp���;�ޞ�L�p�x�.ΘOD�8�h��9�oC�Up�+�0ձ��� Ti�w�m���#���Ҭr�I{� � ���n�\���-�6"q�����`מl9Mv�n��ɌfA�Pw?�`�3g�q{nH����$�z09q�g��>��tV�d5f�f��{�m�v$����v�x>������r�]��W`��ߓ��b =�?���#��+��a�Mw��1,��a��@.���~uv9����v5��֙vV���a��`�e7��ǰ ���tᬮכa�+��a�Mw��@zXo�l�_�VА�JĎ��*in��h�=�G��EVP[��N�>(�{/��su@�k�T��}��5\(A��]Q�d& |�:�� �� PK ! ���� xl/worksheets/sheet6.xml���n�0�����mW�v�6(�Àa�vWd�"���$�ۏ��@1�'����)V��ְ����|�圁S�j����Nj(]+ :�� �m�~���wa ��.�|�q,�j +C�#8:��[)����N���<�Vj�gB�?��� 6��\�!���?zͪ���x�Ў��j��i�rfU��;�rk�몐jaO����c�.f��Џ�oč RS����3]���ࢩ����p�b�ƽEܥ���9P�8��9�S�^�ebRH@q&�����@?=k��{�� t?DچK2�|��iA��q��<���(����㥾�L��*���T*�{W��CST�@��[����sUz=�e?���@7 ���ϊ��c�yM�#�%h�����7�:ĸ$iH�}n� �� PK ! �4�D� xl/worksheets/sheet5.xml���n�0�����]��vQ,(�C�a�z�e�"���$�ۏ��@w� )S��Tq��8BLC)WY.�� ])��~��&E"�0@)ϐ�]��Sq¸O= &�Tʞh�*�L^�����5q;����.y��y�Uym�� ���5�Cs�h�Dp�����7�y���ʠQ[g�<A��f����v���Z��=%��ޚ� [��f��{ި�bRU4�;�."���_IU�p^,�қX�����!hxGR����c�#�KS��ӆ���s�|��N���(����i[?�h��G���l���p����y���Y8[�\l�4骈x�Iv�=��Ֆ�߬ 3�r�a��8V��Bٛ�Y��>��t�lH�A;9��"��c�a�u�vk$B�d=�=`�<�"E�HK2N�� �� PK ! `ٻ� � xl/worksheets/sheet11.xml���n�0������tY[�vˊ�P`�����H�&)I�l8(P� Y��d}�j ;@�]ï��3p ;톆�<?\�r�t�4��'�����V1���\l������j+c����L��AD@v�#kĪ,+��3� _a`�kT{.͐ F&�G��B��+8+�n�/ZO��6:�&(gVU��� ��|�^}�jaO���*`�>��Џ��ĝ R[w�䶳 }���h�9�4㻘�^ow��kxI�#P�5�t�'C�<��3�6ř�>^��t��A/�&���o�Øh��6������nS�b�>���$�:���VT�˼��ӗm��d�����#�"o�z9���v���7��Y[YP��gA7Tm�)�]����LY\s�#�%��8�m� �� PK ! ���m� xl/styles.xml�T[k�0~�?����8K��45�1h{Ul9��HJ�l��ȗĥc�u���w�sSz�J����\�G!FL���j��E���:�**�b>2����R뎂��s ���fE�-�LR{���O���T�#�1�V�_���a8'�r�{��,�DR�xh�Rˆ:�傻c���,W�;� � ��F3Z�6��x�Й^��4���] (�u�K���, -�H �:�(!a�'���VR����'�zT��*�/o���@OT�%�$OK-�A� �vE%�=���[ý[M%��{Cן�Or��7�c8,\�B�XŞ � �Q(h�� �W0=L��(N&H0O��T0��z��<�v@���ޟN7��j�eyZq�ӊ �Jr �� q��[����:�B��*�0����b��+��c���s|@��~F��~g��_0�3@����f՞K�8�,]qNQ���A������O�� K5x}�O�u>�w�S���`���0^p����y�����q�`vɒ`��7A2�^o6�2���_��}��v/L��b����6C����-�����(Оr_���c�AqF�lN�b~�Eś�l}�Ʉ{��W"$Q4�m���Lp5�j��� M�/I���|� �� PK ! ���3I m docProps/core.xml �(� ��QO� ��M� �-��ӑ�K���&&�h|#p�%��{i�՚��#�s?ι!_}�:��d��&E�y#���y��oP�<ӂՍ���Uyy�sCyc��6���@ҎrS����b�sIp� n��G�Æ�w���� <�3�c3�)��4���c�A���I���r��ĩ�?���w�|G�����mۤ��1B��VO}�X�nWP�N��[V���QŤ��ԭ�f�Wa�[ �p�>wv_ex D�ѡ�Iy���o֨�H���2&�:_ҫ�[��|v�P��!f��3B�� �(s|�A�o �� PK ! ȝ�e � xl/tables/table1.xmld��N�0��H���w�$� UM�� 8�� &�4��y7��=NR�G�gv�����w9�����ڝrx?�w� �����s�`W��lY}1�(����HIU�V��w��O�U��$��jj��%�ZZ�]琁p����qh|՚:��ׅ��a�n� س2��χ֟#x�V��Km����bF}�D�{��ʅ>a�?�7�ev�:{��#�[\\�x0���l_�ֽ�%)��:�ɱĤ=��X���0�:R��9�& �7 �� PK ! � � xl/tables/table2.xmld��J�0���!̽�����vQ� �� ��n�)��k������圓3��>�H{W@�I@��}�ݱ��Cuu�X�Fﰀ v��E��ݠ�nGt�VJ�;��6�G_Z��8���>�j�Cdkd�$7�*�@�&~�)�Sh�M�Q���p�n�A�ge�՟��?�� ���W�0���r����`���Ȣa^a��5�¹w�d?UM6i�*��c�<|t�_o6�gl�`c���KԴ�̞�?4-�A�o�39�/M���_ �� PK ! �~��* '